From: Alan Jack Pippin Date: Fri, 31 Aug 2007 02:43:59 +0000 (-0600) Subject: Added error check for thumbnail dimension retrieval X-Git-Tag: 1_1_1~20 X-Git-Url: http://git.pippins.net/embedvideo/.git/?a=commitdiff_plain;h=33a8087570ce671f908df47e4ffaf5163d6ca9d8;p=embedvideo%2F.git Added error check for thumbnail dimension retrieval --- diff --git a/ItemAddEmbedVideo.inc b/ItemAddEmbedVideo.inc index 81b5951..940a4ea 100644 --- a/ItemAddEmbedVideo.inc +++ b/ItemAddEmbedVideo.inc @@ -624,6 +624,10 @@ class ItemAddEmbedVideo extends ItemAddPlugin { // Set the thumbnailHeight to the current thumbnailSize // Set the thumbnailWidth to the appropriate size based on the thumbnailHeight * ratio $image_data = @getimagesize($tmpFile); + if(!$image_data) { + return array(GalleryCoreApi::error(ERROR_STORAGE_FAILURE,__FILE__,__LINE__, + "Unable to retrieve thumbnail dimensions for: $tmpFile"),null,null); + } $ratio = $image_data[0] / $image_data[1]; $debugString.="Using ratio from original thumbnail of $ratio. "; $thumbnailHeight=$thumbnailSize;