Closed parsester closed 3 years ago
Seems like a GD problem, check here: https://github.com/aimeos/aimeos-core/blob/2021.04/lib/mwlib/src/MW/Media/Image/Standard.php#L231-L233
GD problem
ok, but php-gd-8.0.11 installed, what is this problem and what can I do?
You have to find out why imagescale()
returns an error. Maybe the image type isn't supported
You have to find out why
imagescale()
returns an error. Maybe the image type isn't supported
image type is jpg
when I remove IMG_BICUBIC mode from imagescale like as the below, it's correct and save image.
if( ( $result = imagescale( $this->image, $scaleWidth, $scaleHeight ) )...
what can I do?
The IMG_BICUBIC
constant is supported by PHP: https://www.php.net/manual/en/function.imagescale.php
Maybe it's not supported by our underlying GD installation.
You can try to install Imagick PHP extension in addition so this is used for scaling.
The
IMG_BICUBIC
constant is supported by PHP: https://www.php.net/manual/en/function.imagescale.php Maybe it's not supported by our underlying GD installation.You can try to install Imagick PHP extension in addition so this is used for scaling.
I use PHP 8.0.11 by xampp in local development system, and everything is ok and images scale success. so I check phpinfo in both (local and server) and find that in local result is GD Version | bundled (2.1.0 compatible) and in server result is GD library Version | 2.3.3
another difference is in local webserver is apache and in server use nginx with php-fpm
Could this be the reason?
is necessary to use IMG_BICUBIC mode for imagescale?
also in during time to waiting for your answer, I downgrade php version of my server to php 7.4 but anything not change and still I get error from imagescale...
after downgrade and install php 7.4, GD version still is 2.3.3 and not change.
GD is more common and is installed on most hosts and is better to use it for projects instead of Imagick.
if is not necessary to use IMG_BICUBIC and
default mode IMG_BILINEAR_FIXED
is work, please change it, and also please check aimeos yourself to sure work with GD version 2.3.3...
GD is our fallback if Imagick isn't available, even if Imagick is preferrable because it doesn't have problems wen scaling images with transparent backgrounds. Thus, it's good if using most compatible settings for GD and we removed the mode from imagescale()
now. The change is available in dev-master and 2021.10.x-dev.
GD is our fallback if Imagick isn't available, even if Imagick is preferrable because it doesn't have problems wen scaling images with transparent backgrounds. Thus, it's good if using most compatible settings for GD and we removed the mode from
imagescale()
now. The change is available in dev-master and 2021.10.x-dev.
thanks @aimeos please check https://github.com/aimeos/aimeos-core/blob/2021.10/lib/mwlib/src/MW/Media/Image/Standard.php#L286-L288
you remove IMG_BICUBIC
from resize
method but still IMG_BICUBIC
has been used in watermark method.
and return same error.
please remove it from this line.
Thanks for the hint. Now, this occurence has been remove too
Environment
Describe the bug I try to add image media to the product and get error saving data and when check logs, i have "Unable to scale image" error.
why this happen?
this is full error: trace.txt