-
Notifications
You must be signed in to change notification settings - Fork 29
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
IBX-4647: Added WebpFormatVariationPathGenerator handling .webp images #361
IBX-4647: Added WebpFormatVariationPathGenerator handling .webp images #361
Conversation
...ndle/EzPublishCoreBundle/Imagine/VariationPathGenerator/WebpFormatVariationPathGenerator.php
Outdated
Show resolved
Hide resolved
...ndle/EzPublishCoreBundle/Imagine/VariationPathGenerator/WebpFormatVariationPathGenerator.php
Outdated
Show resolved
Hide resolved
return $variationPath; | ||
} | ||
|
||
return $variationPath . '.webp'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
won't this result with e.g. image.jpg.webp
instead of image.webp
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is correct. It looks weird but webp
format actually uses double extension: https://symfony.com/bundles/LiipImagineBundle/current/basic-usage.html#use-webp-if-supported
...lishCoreBundle/Tests/Imagine/VariationPathGenerator/WebpFormatVariationPathGeneratorTest.php
Outdated
Show resolved
Hide resolved
); | ||
|
||
self::assertEquals( | ||
'tmp/variation/test.jpeg.webp', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it really correct? Not test.webp
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. WebP format can work with JPEGs, GIFs and PNGs.
...lishCoreBundle/Tests/Imagine/VariationPathGenerator/WebpFormatVariationPathGeneratorTest.php
Outdated
Show resolved
Hide resolved
...lishCoreBundle/Tests/Imagine/VariationPathGenerator/WebpFormatVariationPathGeneratorTest.php
Outdated
Show resolved
Hide resolved
Fixed all remarks: 7e76a66 I moved |
src/bundle/Core/Imagine/VariationPathGenerator/WebpFormatVariationPathGenerator.php
Outdated
Show resolved
Hide resolved
src/bundle/Core/Imagine/VariationPathGenerator/WebpFormatVariationPathGenerator.php
Outdated
Show resolved
Hide resolved
tests/bundle/Core/Imagine/VariationPathGenerator/WebpFormatVariationPathGeneratorTest.php
Show resolved
Hide resolved
src/bundle/Core/Imagine/VariationPathGenerator/WebpFormatVariationPathGenerator.php
Show resolved
Hide resolved
e201da1
to
d53b18f
Compare
Kudos, SonarCloud Quality Gate passed!
|
Could you please merge up changes @webhdx ? |
v3.3
liip/imagine
package has support for generating.webp
images. You can explicitly defineformat: webp
for image variation and it'll encode the image + serve it with.webp
extension. This isn't supported on our side. Even if you useformat: webp
configuration, the image is encoded properly but it's still returned with original file extension. This PR adds newVariationPathGenerator
that checks for webp format and applies.webp
file extension.Checklist:
$ composer fix-cs
).@ezsystems/engineering-team
).