On my system it is not possible to save a GMagick image to a file without a file extension. The Exception No encode delegate for this image format (jpeg) gets thrown.
What's the PHP version you are using?
7.3.13-1+ubuntu16.04.1+deb.sury.org+1
What's the imaging library you are using [gd/imagick/gmagick/any]?
GMagick
What's the imaging library configuration
gmagick version => 2.0.5RC1
GraphicsMagick version => GraphicsMagick 1.4 snapshot-20180922 Q16 http://www.GraphicsMagick.org/
Minimal PHP code to reproduce the error:
$gmagick = new \Gmagick();
$gmagick->newimage(100, 100, (new \GmagickPixel('#ffffff'))->getcolor(false));
$gmagick->setimageformat('jpeg');
$gmagick->writeimage(__DIR__.'/testimage');
How to fix
The GraphicsMagick documentation shows the image format in uppercase ("GIF") and if I replace the 'jpeg' with 'JPEG' in the test code above this fixes the issue for me.
Issue description
On my system it is not possible to save a GMagick image to a file without a file extension. The Exception
No encode delegate for this image format (jpeg)
gets thrown.What's the PHP version you are using?
7.3.13-1+ubuntu16.04.1+deb.sury.org+1
What's the imaging library you are using [gd/imagick/gmagick/any]?
GMagick
What's the imaging library configuration
Minimal PHP code to reproduce the error:
How to fix
The GraphicsMagick documentation shows the image format in uppercase (
"GIF"
) and if I replace the'jpeg'
with'JPEG'
in the test code above this fixes the issue for me.I think we should replace https://github.com/avalanche123/Imagine/blob/3db069bd870f45b5305e7d6bd4e08d45ebb22cef/src/Gmagick/Image.php#L433 with: