View file load/screen.php

File size: 1.35Kb
<?
Error_Reporting(E_ALL & ~E_NOTICE);
include("func.php");
include("set.php");
include("start.php");

$did=security($did);
$fid=security($fid);
$dir_work="$dir_load/$did";
$file_work="$dir_work/$fid";

if(file_exists("$dir_load/$did/$fid"))
{
  $mov = new ffmpeg_movie("$dir_load/$did/$fid");
  $w = $mov->GetFrameWidth();
  $h = $mov->GetFrameHeight();
  $ff_frame = $mov->getFrame(1);
  if($ff_frame)
  {
    $gd_image = $ff_frame->toGDImage();
    if($gd_image)
    {
      $des_img = imagecreatetruecolor($w, $h);
      $s_img = $gd_image;
      imagecopyresampled($des_img, $s_img, 0, 0, 0, 0, $w, $h, $w, $h);
      Header("Content-type: image/png");
      imagepng($des_img);
      imagedestroy($des_img);
      imagedestroy($s_img);
    }
    else
    {
      $img=imageCreate(50,50);
      $blc=imagecolorallocate($img,0,0,0);
      $red=imagecolorallocate($img,255,0,0);
      imagettftext($img, 10, 0, 10, 10, $red, "img/comicbd.ttf","No GD");
      Header("Content-type: image/png");
      imagepng($img);  
      imageDestroy($img);
    }
  }
}
else
{
  $img=imageCreate(80,30);
  $blc=imagecolorallocate($img,0,0,0);
  $red=imagecolorallocate($img,255,0,0);
  imagettftext($img, 10, 0, 10, 10, $red, "img/comicbd.ttf","Not Found");
  Header("Content-type: image/png");
  imagepng($img);  
  imageDestroy($img);
}

?>