cphalcon icon indicating copy to clipboard operation
cphalcon copied to clipboard

[BUG]: GD with enabled webp support, but still return error

Open borisdelev opened this issue 4 years ago • 10 comments

Description My PHP GD configuration support webp image format. I test it with simple imagecreatefromwebp function and it worked. But when use \Phalcon\Image\Adapter\Gd- i've got "Installed GD does not support image/webp images" error

PHP Windows 11, PHP 8.0.15 with Phalcon 5.0.0 Alpha 6 (but i tried it with RC- same error) image

To Reproduce Just use next line:

new \Phalcon\Image\Adapter\Gd($path_to_webp_example_file);

Expected behavior Well... to manipulate webp format images

Details

  • Phalcon version: 5.0.0alpha6
  • PHP Version: 8.0.15
  • Operating System: Windows
  • Server: Apache

Finish Well- that's it. Maybe i am wrong somewhere or it is not a bug (it is a feature :), but i want to fix so... you are my hope :) THANK YOU all Phalcon supporters. Wish u luck and... may the force be with you!

borisdelev avatar Jun 01 '22 19:06 borisdelev

Well, as you are using alpha6, my suggest is to try RC1, and see if problem persists. but you will probably need to adjust some of code inside your project due namespace changes.

Jeckerson avatar Jun 01 '22 22:06 Jeckerson

It is probably the GD in the system that is not recognized by Phalcon. There is no reason why imagecreatefromwebp works in a plain php script and does not in Phalcon

I will see if I can create a failing test.

niden avatar Jun 01 '22 22:06 niden

Well, as you are using alpha6, my suggest is to try RC1, and see if problem persists. but you will probably need to adjust some of code inside your project due namespace changes.

yeah, i tried in RC1 too, same error

I tried like this:

$im = imagecreatefromwebp($path_to_webp_example_file);
imagejpeg($im, $path_to_jpg_file, 100);
imagedestroy($im);

         
$image = new \Phalcon\Image\Adapter\Gd($path_to_webp_example_file); // Error here

PS: i've manage to use original PHP GD function and resize/crop webp image format and create fallback to my project... but its good to fix that for the final 5 :) Thanks guys. You are the best!

borisdelev avatar Jun 02 '22 05:06 borisdelev

@borisdelev I found where the issue lies.....

The Gd adapter does not support webp images. I thought it did but I was reading the wbmp method.

I wrote a couple of tests and will see if I can get this in the next version.

niden avatar Jun 10 '22 02:06 niden

Like i said before- u are the best 😊

borisdelev avatar Jun 10 '22 03:06 borisdelev

Resolved in https://github.com/phalcon/cphalcon/pull/15989

niden avatar Jun 10 '22 15:06 niden

Hi hi hi... something strange... when i try to save webp image... I am with Phalcon 5.0.0RC3 Phalcon\Image\Exception: Installed GD does not support 'webp' images

But in info file: image

Sorry to bother you @niden , but can u just check that?

borisdelev avatar Jul 15 '22 14:07 borisdelev

Issue has not been resolved in RC3.

niden avatar Jul 19 '22 20:07 niden

Resolved in https://github.com/phalcon/cphalcon/pull/16044

niden avatar Aug 08 '22 12:08 niden

@borisdelev I believe it is fixed for good now :)

niden avatar Aug 08 '22 12:08 niden