]> git.mxchange.org Git - friendica.git/commitdiff
slight adjustment to Photo scaling - also discovered imagick resize may need some...
authorfriendica <info@friendica.com>
Sat, 29 Sep 2012 12:46:01 +0000 (05:46 -0700)
committerfriendica <info@friendica.com>
Sat, 29 Sep 2012 12:46:01 +0000 (05:46 -0700)
include/Photo.php

index 42b54b14e86ca727b1538de5521f42d0ec0c0d0b..4ab58369ec94203b8d1cbd749acdb3012cac87c2 100644 (file)
@@ -213,8 +213,16 @@ class Photo {
             // Don't forget to go back to the first frame
             $this->image->setFirstIterator();
             do {
+
+                               // FIXME - implement horizantal bias for scaling as in followin GD functions
+                               // to allow very tall images to be constrained only horizontally. 
+
                 $this->image->resizeImage($max, $max, imagick::FILTER_LANCZOS, 1, true);
             } while ($this->image->nextImage());
+
+                       // FIXME - also we need to copy the new dimensions to $this->height, $this->width as other functions
+                       // may rely on it.
+
             return;
         }
 
@@ -256,11 +264,11 @@ class Photo {
                 if( $height > $max ) {
 
                                        // very tall image (greater than 16:9)
-                                       // constrain the width - let the height float.
+                                       // but width is OK - don't do anything
 
                                        if((($height * 9) / 16) > $width) {
-                                               $dest_width = $max;
-                               $dest_height = intval(( $height * $max ) / $width);
+                                               $dest_width = $width;
+                               $dest_height = $height;
                                        }
                                        else {
                            $dest_width = intval(( $width * $max ) / $height);