]> git.mxchange.org Git - friendica.git/blobdiff - src/Object/Image.php
bump version 2023.12
[friendica.git] / src / Object / Image.php
index d6c897e88dcf392dd80a85ecaea9a383852084ab..28fa636be265aa94898ebd8baefc245154b3c123 100644 (file)
@@ -600,7 +600,7 @@ class Image
                        do {
                                $this->image->cropImage($w, $h, $x, $y);
                                /*
-                                * We need to remove the canva,
+                                * We need to remove the canvas,
                                 * or the image is not resized to the crop:
                                 * http://php.net/manual/en/imagick.cropimage.php#97232
                                 */
@@ -612,6 +612,7 @@ class Image
                $dest = imagecreatetruecolor($max, $max);
                imagealphablending($dest, false);
                imagesavealpha($dest, true);
+
                if ($this->type=='image/png') {
                        imagefill($dest, 0, 0, imagecolorallocatealpha($dest, 0, 0, 0, 127)); // fill with alpha
                }
@@ -718,7 +719,7 @@ class Image
                                if ($image->isImagick()) {
                                        try {
                                                $colors = $image->image->getImagePixelColor($x, $y)->getColor();
-                                       } catch (\Throwable $th) {
+                                       } catch (\Exception $exception) {
                                                return '';
                                        }
                                        $row[] = [$colors['r'], $colors['g'], $colors['b']];