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

Add support for image format conversion #552

Merged
merged 12 commits into from Jul 5, 2019

Conversation

Projects
None yet
3 participants
@ausi
Copy link
Member

commented Jul 4, 2019

Depends on contao/image#53
Related: avalanche123/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.

@ausi ausi added the feature label Jul 4, 2019

@ausi ausi self-assigned this Jul 4, 2019

@ausi

This comment has been minimized.

Copy link
Member Author

commented Jul 4, 2019

Todo:

  • Replace helptext with “Your platform doesn’t support WEBP images“ if WEBP is not supported.
  • Fix tests

@leofeyer leofeyer added this to the 4.8 milestone Jul 4, 2019

ausi added some commits Jul 4, 2019

@@ -164,6 +165,12 @@ private function createConfig($size): array
if (null !== $imageSizes) {
$options->setSkipIfDimensionsMatch((bool) $imageSizes->skipIfDimensionsMatch);
$config->setFormats(

This comment has been minimized.

Copy link
@Toflar

Toflar Jul 4, 2019

Member

Are you sure this works? Afaics the values are encoded in the db? Also, we need the same option in the new contao.image.sizes altough there I guess we should accept an array notation?

This comment has been minimized.

Copy link
@ausi

ausi Jul 5, 2019

Author Member

Yes, works :)

Added formats to contao.image.sizes in 7465bcc

ausi and others added some commits Jul 5, 2019

@leofeyer leofeyer merged commit e069cab into contao:master Jul 5, 2019

3 checks passed

Travis CI - Pull Request Build Passed
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
coverage/coveralls Coverage decreased (-0.05%) to 87.097%
Details
@leofeyer

This comment has been minimized.

Copy link
Member

commented Jul 5, 2019

Thank you @ausi.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.