Moar error handling for r53546
authorAndrew Garrett <werdna@users.mediawiki.org>
Mon, 10 Aug 2009 09:32:55 +0000 (09:32 +0000)
committerAndrew Garrett <werdna@users.mediawiki.org>
Mon, 10 Aug 2009 09:32:55 +0000 (09:32 +0000)
includes/media/GIF.php

index ef06aa7..fba54ae 100644 (file)
@@ -24,8 +24,12 @@ class GIFHandler extends BitmapHandler {
        }
        
        function getImageArea( $image, $width, $height ) {
-               $metadata = unserialize($image->getMetadata());
-               return $width * $height * $metadata['frameCount'];
+               if ($metadata) {
+                       $metadata = unserialize($image->getMetadata());
+                       return $width * $height * $metadata['frameCount'];
+               } else {
+                       return $width * $height;
+               }
        }
        
        function getMetadataType( $image ) {