]> git.mxchange.org Git - friendica.git/commitdiff
orient function uses exif_read_data for which valid image types are only JPEG and...
authorVasudev Kamath <kamathvasudev@gmail.com>
Sat, 7 Jul 2012 10:47:26 +0000 (16:17 +0530)
committerVasudev Kamath <kamathvasudev@gmail.com>
Sat, 7 Jul 2012 10:47:26 +0000 (16:17 +0530)
When trying to upload an screenshot with png type I was getting message as *failed* even though image was uploading. So added a fix to check image type before calling orient function. Not sure if this is a proper fix but after this i'm not getting any error during file upload

[1] http://au2.php.net/manual/en/function.exif-read-data.php

mod/photos.php

index 624f0bdcaa2038367cffb47bd0780deeffade527..42cad42f9c9bed557c40077a1877f09b87a20ee5 100644 (file)
@@ -740,7 +740,8 @@ function photos_post(&$a) {
                killme();
        }
 
-       $ph->orient($src);
+        if($ph->getType() != 'image/png')
+            $ph->orient($src);
        @unlink($src);
 
        $max_length = get_config('system','max_image_length');