Skip to content
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

Fix WEBP support in GD driver #718

Closed
wants to merge 6 commits into from
Closed

Conversation

ausi
Copy link
Contributor

@ausi ausi commented Jul 4, 2019

Fixes several issues with handling WEBP images with the GD driver:

  • imagecreatefromstring() doesn’t support WEBP in PHP versions lower than 7.3.0 ac7609d
  • webp_quality option was ignored 75d75a1
  • Supported formats didn’t check if webp is actually available f85731b

This pull request is an alternative to #711, it uses less code and doesn’t require a temp directory.

@mlocati is it OK to have all those fixes in a single pull request or should I create one PR for every fix?

@ausi ausi mentioned this pull request Jul 4, 2019
@ausi
Copy link
Contributor Author

ausi commented Jul 4, 2019

The failed build on Travis CI (PHP 5.5 imagick) doesn’t seem to be related to my changes.

leofeyer pushed a commit to contao/contao that referenced this pull request Jul 5, 2019
Description
-----------

Depends on contao/image#53
Related: php-imagine/Imagine#718

As @Toflar pointed out in contao/image#53 (comment) this feature makes it possible to automatically generate WEBP images.

I didn’t add `webp` to the default `contao.image.valid_extensions` configuration because not all plattforms support it. If someone wants to use this feature they need to add `webp` to the valid extensions in their *config.yml*.

Commits
-------

1b6ec2a Add support for image format conversion
271a98a Show help message if WEBP is not enabled
c67f82f Use 1.0.0-beta3 version of contao/image
c094d19 Fix tests
4631a2b Fix PHPStan issues
7465bcc Add formats to predifined sizes configuration
f71cd1e Fix image and picture tests
f3866e3 Fix PHPStan issues
b9fe888 Fix PHPStan issues
efe0c65 Fix the coding style
61accc2 Don’t use JSON for the formats option
a6cf0a9 Fix the coding style
leofeyer pushed a commit to contao/core-bundle that referenced this pull request Jul 5, 2019
Description
-----------

Depends on contao/image#53
Related: php-imagine/Imagine#718

As @Toflar pointed out in contao/image#53 (comment) this feature makes it possible to automatically generate WEBP images.

I didn’t add `webp` to the default `contao.image.valid_extensions` configuration because not all plattforms support it. If someone wants to use this feature they need to add `webp` to the valid extensions in their *config.yml*.

Commits
-------

1b6ec2ac Add support for image format conversion
271a98af Show help message if WEBP is not enabled
c67f82fe Use 1.0.0-beta3 version of contao/image
c094d193 Fix tests
4631a2b0 Fix PHPStan issues
7465bcc3 Add formats to predifined sizes configuration
f71cd1e3 Fix image and picture tests
f3866e34 Fix PHPStan issues
b9fe8884 Fix PHPStan issues
efe0c653 Fix the coding style
61accc28 Don’t use JSON for the formats option
a6cf0a9a Fix the coding style
mlocati pushed a commit to mlocati/Imagine that referenced this pull request Jul 8, 2019
@mlocati
Copy link
Collaborator

mlocati commented Jul 8, 2019

Rewritten as #719 (I like to give credits to every contributor):

@mlocati mlocati closed this Jul 8, 2019
@ausi
Copy link
Contributor Author

ausi commented Jul 8, 2019

Thank you @mlocati!

I noticed that my changes from AbstractImagineTest and AbstractImageTest didn’t get copied over.
If that wasn’t on purpose, I’m happy to create another pull request with the tests if you want me to.

@mlocati
Copy link
Collaborator

mlocati commented Jul 8, 2019

@ausi My fault: I should have added them

mlocati added a commit that referenced this pull request Jul 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants