1

I have an error, with Suphp activated, no problem, but with Suphp not activated I have this error appears

I suppose in this case imagewebp is not supported by the server. Do you know how to resolve this ?

[26-Dec-2019 02:17:59 America/New_York] PHP Fatal error:  Uncaught Error: Call to undefined function Catalog\Products\Classes\ClicShoppingAdmin\imagewebp() in {PATH}/Catalog/Products/Classes/ClicShoppingAdmin/ImageResample.php:101

Also I would like to add that the image in successfully added in "/sources/images/products/" with .jpg extension. On the contrary, in SuPHP server where is image is uploaded successfully the image is saved with ".jpg.webp" in same location. I guess something is breaking during image conversion while saving an image.

Thank you.

There my function

line 101 is : imagewebp( $this->image, $filename, $compression );

 public function save(string $filename, string $image_type = IMAGETYPE_WEBP, int $compression = 80, $permissions = null, bool $convertAll = true)
    {
      if ($convertAll === true) {
        imagewebp( $this->image, $filename, $compression );
      } else {
        if ($image_type == IMAGETYPE_JPEG) {
          imagejpeg($this->image, $filename, $compression);
        } elseif ($image_type == IMAGETYPE_GIF) {
          imagegif($this->image, $filename);
        } elseif ($image_type == IMAGETYPE_PNG) {
          imagepng($this->image, $filename);
        } elseif ($image_type == IMAGETYPE_WEBP) {
          imagewebp($this->image, $filename);
        }
      }

      if (!is_null($permissions)) {
        chmod($filename, $permissions);
      }
    }
4

0 回答 0