]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
ImageFile constructor changed to align with existing code
authorMikael Nordfeldth <mmn@hethane.se>
Wed, 25 Feb 2015 00:31:44 +0000 (01:31 +0100)
committerMikael Nordfeldth <mmn@hethane.se>
Wed, 25 Feb 2015 00:31:44 +0000 (01:31 +0100)
Noone passed type, width or height to new ImageFile(...) and
in all instances, both parameters were set (though $id is null on occasion).

lib/imagefile.php

index fa57d524e5fbb0ccb11ff653593d9cf1e94690f9..f123d4748541a9ea46e7afee39e50f7a15446082 100644 (file)
@@ -54,7 +54,7 @@ class ImageFile
     var $rotate=0;  // degrees to rotate for properly oriented image (extrapolated from EXIF etc.)
     var $animated = null;  // Animated image? (has more than 1 frame). null means untested
 
-    function __construct($id=null, $filepath=null, $type=null, $width=null, $height=null)
+    function __construct($id, $filepath)
     {
         $this->id = $id;
         $this->filepath = $filepath;
@@ -74,9 +74,9 @@ class ImageFile
             throw new UnsupportedMediaException(_('Unsupported image format.'), $this->filepath);
         }
 
-        $this->type = ($info) ? $info[2]:$type;
-        $this->width = ($info) ? $info[0]:$width;
-        $this->height = ($info) ? $info[1]:$height;
+        $this->width    = $info[0];
+        $this->height   = $info[1];
+        $this->type     = $info[2];
 
         if ($this->type == IMAGETYPE_JPEG && function_exists('exif_read_data')) {
             // Orientation value to rotate thumbnails properly