File size: 1.75Kb
<?
if (is_file(DCMS_LF_PATH.'.GIF'))
echo "<a href='screen/".(DCMS_SCR_WIDTH*3).'/'.convert_to_utf8(DCMS_LE.'/'.DCMS_LF_FILE.".GIF")."'><img src='screen/".DCMS_SCR_WIDTH.'/'.convert_to_utf8(DCMS_LE.'/'.DCMS_LF_FILE.".GIF")."' alt='Скрин...' /></a><br />\n";
elseif (is_file(DCMS_LF_PATH.'.JPG'))
echo "<a href='screen/".(DCMS_SCR_WIDTH*3).'/'.convert_to_utf8(DCMS_LE.'/'.DCMS_LF_FILE.".JPG")."'><img src='screen/".DCMS_SCR_WIDTH.'/'.convert_to_utf8(DCMS_LE.'/'.DCMS_LF_FILE.".JPG")."' alt='Скрин...' /></a><br />\n";
elseif (is_file(DCMS_LF_PATH.'.PNG'))
echo "<a href='screen/".(DCMS_SCR_WIDTH*3).'/'.convert_to_utf8(DCMS_LE.'/'.DCMS_LF_FILE.".PNG")."'><img src='screen/".DCMS_SCR_WIDTH.'/'.convert_to_utf8(DCMS_LE.'/'.DCMS_LF_FILE.".PNG")."' alt='Скрин...' /></a><br />\n";
elseif (class_exists('ffmpeg_movie')){
$media = new ffmpeg_movie(DCMS_LF_PATH);
$k_frame=intval($media->getFrameCount());
$w = $media->GetFrameWidth();
$h = $media->GetFrameHeight();
$k_kadr=6; // количество кадров в анимации
for ($i=0;$i<$k_kadr;$i++)
{
$ff_frame = $media->getFrame(intval($k_frame/($k_kadr/($i+1))));
if ($ff_frame) {
$gd_image = $ff_frame->toGDImage();
if ($gd_image) {
$frames[$i]=H."sys/tmp/frame_$sess.$i.gif";
imagegif($gd_image,$frames[$i]);
@chmod($frames[$i], 0777);
$framed [$i] = 60;
imagedestroy($gd_image);
}
}
}
include_once H.'sys/inc/gifencoder.php';
$gif = @new GIFEncoder ($frames,$framed,0,2,0,0,0,'url');
$screen=$gif->GetAnimation();
@file_put_contents(DCMS_LF_PATH.'.GIF', $screen);
@chmod(DCMS_LF_PATH.'.GIF',0777);
for ($i=0;$i<$k_kadr;$i++)
{
unlink(H."sys/tmp/frame_$sess.$i.gif");
}
if ($screen)echo "<img src='screen/".DCMS_SCR_WIDTH.'/'.convert_to_utf8(DCMS_LE.'/'.DCMS_LF_FILE.".GIF")."' alt='Скрин...' /><br />\n";
}
?>