Hey Abbas,
Fantastic Hack - thanks.
I did notice one thing though. If you want the dimensions of the movie to be properly collected, you need to change
} elseif (is_movie($image)) {
preg_match("/(.+)\.(.*?)\Z/", $filename, $matches);
$thumb = $CONFIG['fullpath'] . $filepath . $CONFIG['thumb_pfx'] . $matches[1].".jpg";
$videoThumb = create_movie_thumb($image);
if ($videoThumb) {
if (!resize_image($videoThumb, $thumb, $CONFIG['thumb_width'], $CONFIG['thumb_method'], $CONFIG['thumb_use'])) {
return false;
}
@unlink($videoThumb);
$imagesize = getimagesize($thumb);
} else {
return false;
}
to:
} elseif (is_movie($image)) {
preg_match("/(.+)\.(.*?)\Z/", $filename, $matches);
$thumb = $CONFIG['fullpath'] . $filepath . $CONFIG['thumb_pfx'] . $matches[1].".jpg";
$videoThumb = create_movie_thumb($image);
$imagesize = getimagesize($videoThumb);
if ($videoThumb) {
if (!resize_image($videoThumb, $thumb, $CONFIG['thumb_width'], $CONFIG['thumb_method'], $CONFIG['thumb_use'])) {
return false;
}
@unlink($videoThumb);
} else {
return false;
}
Note that I have removed your getimagesize line and replaced it further up in the code and changed the variable from $thumb to $videoThumb
The way you had it, it always grabbed the dimensions of the thumbnail, rather than the actual fullsize video.
I also commented out these lines in upload.php:
//Add width and height boxes to the form.
//$form_array[] = array($lang_admin_php['th_wd'],'movie_wd', 0, 4, 1); //no longer needed since dimensions of movies are grabbed automatically
//$form_array[] = array($lang_admin_php['th_ht'],'movie_ht', 0, 4, 1); //no longer needed since dimensions of movies are grabbed automatically
because it is no longer necessary for the user to enter the movie dimensions manually.
Thanks again,
Adrian