void-linux / void-packages

The Void source packages collection
https://voidlinux.org
Other
2.56k stars 2.13k forks source link

PHP: Extension GD not built with JPEG support #51237

Closed ILadis closed 2 months ago

ILadis commented 3 months ago

Is this a new report?

Yes

System Info

Void 6.6.35_1 armv7l Unknown uptodate hold rFFFFF

Package(s) Affected

php-8.3_1, php-gd-8.3_1

Does a report exist for this bug with the project's home (upstream) and/or another distro?

No

Expected behaviour

I've enabling the gd extension in my php.ini. By doing so I could previously parse JPEG images using imagecreatefromstring for example.

The gd library still seems to have support for JPEG images because I could compile and run their C example which outputs a JPEG test image.

My guess is that some update to the php8.3 or php8.3-gd package broke the support for JPEG images.

Actual behaviour

Now the following error is thrown:

$ php -r 'imagecreatefromstring(file_get_contents("test.jpg"));'
imagecreatefromstring(): No JPEG support in this PHP build

Also gd_info() mentions no support for JPEG images:

$ php -r 'print_r(gd_info());'
Array
(
    [GD Version] => 2.3.3
    [FreeType Support] => 1
    [FreeType Linkage] => with freetype
    [GIF Read Support] => 1
    [GIF Create Support] => 1
    [JPEG Support] => 
    [PNG Support] => 
    [WBMP Support] => 1
    [XPM Support] => 
    [XBM Support] => 1
    [WebP Support] => 
    [BMP Support] => 
    [AVIF Support] => 
    [TGA Read Support] => 
    [JIS-mapped Japanese Font Support] => 
)

Steps to reproduce

The following command should not output an error message (provided that test.jpg exists):

php -r 'imagecreatefromstring(file_get_contents("test.jpg"));'
ILadis commented 3 months ago

Seems to be an ARM or Raspberry Pi related issue.

On a x64 machine JPEG support seems to be working:

$ xuname
Void 6.6.38_1 x86_64 AuthenticAMD uptodate rrrmFFFFFF
$ php -r 'print_r(gd_info());'
Array
(
    [GD Version] => 2.3.3
    [FreeType Support] => 1
    [FreeType Linkage] => with freetype
    [GIF Read Support] => 1
    [GIF Create Support] => 1
    [JPEG Support] => 1
    [PNG Support] => 1
    [WBMP Support] => 1
    [XPM Support] => 1
    [XBM Support] => 1
    [WebP Support] => 1
    [BMP Support] => 1
    [AVIF Support] => 
    [TGA Read Support] => 1
    [JIS-mapped Japanese Font Support] => 
)
classabbyamp commented 2 months ago

cc @TinfoilSubmarine

ILadis commented 2 months ago

Thanks for fixing, can confirm it's working again.