]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/imagefile.php
Merge remote-tracking branch 'upstream/nightly' into nightly
[quix0rs-gnu-social.git] / lib / imagefile.php
index 85fc59712690c7f6c1554d519294eb10729ed050..b0cd13089f64e1579d456473b6601a09801f31cb 100644 (file)
@@ -132,7 +132,7 @@ class ImageFile
             // First some mimetype specific exceptions
             switch ($file->mimetype) {
             case 'image/svg+xml':
-                throw new UseFileAsThumbnailException($file->id);
+                throw new UseFileAsThumbnailException($file);
             }
 
             // And we'll only consider it an image if it has such a media type
@@ -282,7 +282,11 @@ class ImageFile
         }
 
         if (!file_exists($outpath)) {
-            throw new UseFileAsThumbnailException($this->id);
+            if ($this->fileRecord instanceof File) {
+                throw new UseFileAsThumbnailException($this->fileRecord);
+            } else {
+                throw new UnsupportedMediaException('No local File object exists for ImageFile.');
+            }
         }
 
         return $outpath;
@@ -544,7 +548,7 @@ class ImageFile
         }
 
         fclose($fh);
-        return $count > 1;
+        return $count >= 1; // number of animated frames apart from the original image
     }
 
     public function getFileThumbnail($width, $height, $crop, $upscale=false)