Skip to content

GD Extension compiles without JPEG Support #881

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
GrahamCampbell opened this issue Aug 27, 2019 · 7 comments
Closed

GD Extension compiles without JPEG Support #881

GrahamCampbell opened this issue Aug 27, 2019 · 7 comments

Comments

@GrahamCampbell
Copy link

When I put docker-php-ext-install gd in the Dockerfile extending php:7.3.8-cli, the result is that the extension is compiled without support for JPEG.

The result when calling var_dump(gd_info()) on PHP shipped with MacOS:

  ["GD Version"]=>
  string(26) "bundled (2.1.0 compatible)"
  ["FreeType Support"]=>
  bool(false)
  ["GIF Read Support"]=>
  bool(true)
  ["GIF Create Support"]=>
  bool(true)
  ["JPEG Support"]=>
  bool(true)
  ["PNG Support"]=>
  bool(true)
  ["WBMP Support"]=>
  bool(true)
  ["XPM Support"]=>
  bool(false)
  ["XBM Support"]=>
  bool(true)
  ["WebP Support"]=>
  bool(false)
  ["BMP Support"]=>
  bool(true)
  ["JIS-mapped Japanese Font Support"]=>
  bool(false)
}

The result from the docker version:

array(12) {
  ["GD Version"]=>
  string(26) "bundled (2.1.0 compatible)"
  ["FreeType Support"]=>
  bool(false)
  ["GIF Read Support"]=>
  bool(true)
  ["GIF Create Support"]=>
  bool(true)
  ["JPEG Support"]=>
  bool(false)
  ["PNG Support"]=>
  bool(true)
  ["WBMP Support"]=>
  bool(true)
  ["XPM Support"]=>
  bool(false)
  ["XBM Support"]=>
  bool(true)
  ["WebP Support"]=>
  bool(false)
  ["BMP Support"]=>
  bool(true)
  ["JIS-mapped Japanese Font Support"]=>
  bool(false)
}
@tianon
Copy link
Member

tianon commented Aug 27, 2019

This is somewhat expected; see https://github.com/docker-library/wordpress/blob/1283fde76747fe5992e714b782b01a65e9973a47/Dockerfile-debian.template#L16 for an example (docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr).

@GrahamCampbell
Copy link
Author

Ah, right. Thanks. I guess this is not a bug then. :P

@patrickomeara
Copy link
Contributor

I'm now getting this issue with PHP 7.4

I have the --with-jpeg-dir=/usr option but still no jpeg support in gd

I have tried with both libjpeg62-turbo-dev and libjpeg-dev, both produce the same result.

php -i from 7.4

gd

GD Support => enabled
GD Version => bundled (2.1.0 compatible)
GIF Read Support => enabled
GIF Create Support => enabled
PNG Support => enabled
libPNG Version => 1.6.36
WBMP Support => enabled
XBM Support => enabled
BMP Support => enabled
TGA Read Support => enabled

php -i from 7.3

gd

GD Support => enabled
GD Version => bundled (2.1.0 compatible)
FreeType Support => enabled
FreeType Linkage => with freetype
FreeType Version => 2.9.1
GIF Read Support => enabled
GIF Create Support => enabled
JPEG Support => enabled
libJPEG Version => 6b
PNG Support => enabled
libPNG Version => 1.6.36
WBMP Support => enabled
XBM Support => enabled

@patrickomeara
Copy link
Contributor

Looks like gd isn't liking the options

RUN docker-php-ext-configure gd --with-freetype-dir=/usr --with-jpeg-dir=/usr --with-png-dir=/usr \
  && docker-php-ext-install -j "$(nproc)" gd
Configuring for:
PHP Api Version:         20190902
Zend Module Api No:      20190902
Zend Extension Api No:   320190902
configure: WARNING: unrecognized options: --with-freetype-dir, --with-jpeg-dir, --with-png-dir

@patrickomeara
Copy link
Contributor

I've created a new issue #912

jakubboucek added a commit to jakubboucek/docker-lamp-devstack that referenced this issue Feb 23, 2020
@arukompas
Copy link

For those new (like me) to configuring PHP extensions, make sure you run the configuration command before you install the extension itself.

# first configure the to-be-installed extension
RUN docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr

# Only then install it
RUN docker-php-ext-install gd

@thigarette

This comment was marked as duplicate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants