]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Save thumbnails with proper extension
authorMikael Nordfeldth <mmn@hethane.se>
Wed, 25 Feb 2015 00:34:00 +0000 (01:34 +0100)
committerMikael Nordfeldth <mmn@hethane.se>
Wed, 25 Feb 2015 00:34:00 +0000 (01:34 +0100)
This might cause double extensions, but that's ok since the filename
is stored in the database. We might want to look at it later though.

classes/File.php

index 8fd040b7e9f87062cc7d94630e3107060855960b..242d109804ffb0190fbd19c2abba5fa1bd71f944 100644 (file)
@@ -442,7 +442,7 @@ class File extends Managed_DataObject
         }
 
         // throws exception on failure to generate thumbnail
-        $outname = "thumb-{$width}x{$height}-" . $image->filename;
+        $outname = "thumb-{$width}x{$height}-{$image->filename}." . File::guessMimeExtension($image->mimetype);
         $outpath = self::path($outname);
 
         // The boundary box for our resizing