Bläddra i källkod

Reorder image resizing operations

Visman 5 år sedan
förälder
incheckning
4c2c686d3e
1 ändrade filer med 3 tillägg och 3 borttagningar
  1. 3 3
      app/Core/Image.php

+ 3 - 3
app/Core/Image.php

@@ -88,12 +88,12 @@ class Image extends File
         if ($palette > 0 && ! \imagetruecolortopalette($image, true, $palette)) {
             throw new FileException('Failed to convert image to palette');
         }
-        if (false === \imagecopyresampled($image, $this->image, 0, 0, 0, 0, $width, $height, $oldW, $oldH)) {
-            throw new FileException('Failed to resize image');
-        }
         if (false === \imagealphablending($image, false) || false === \imagesavealpha($image, true)) {
             throw new FileException('Failed to adjust image');
         }
+        if (false === \imagecopyresampled($image, $this->image, 0, 0, 0, 0, $width, $height, $oldW, $oldH)) {
+            throw new FileException('Failed to resize image');
+        }
 
         $this->image = $image;