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

NGSTACK-901 Webp support #201

Open
wants to merge 2 commits into
base: 1.12
Choose a base branch
from
Open

NGSTACK-901 Webp support #201

wants to merge 2 commits into from

Conversation

hknezevic
Copy link
Member

@hknezevic hknezevic commented Jun 21, 2024

Requires netgen/site-bundle#51 to be reviewed and merged first.

This PR enables WebP support for legacy kernel/admin UI, and sets all image aliases generated in legacy kernel or through LiipImagine bundle to be converted, stored and outputted in WebP format.

This feature requires Imagemagick with libwebp delegate library included.

@@ -57,10 +57,15 @@ ezpublish:
- { name: strip }

liip_imagine:
# global setting, all filters will generate webp images
default_filter_set_settings:
format: webp
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With this, we're enabling generation of webp by default for all filters, even if the source is jpg or png? If so, that does not sound right?

Copy link
Member Author

@hknezevic hknezevic Aug 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the whole point of the PR. We want to output webp for all web images. Imagick has a possibility of generating webp variations from the source JPG or PNG.
At least that is what Vjeran told me he wants to achieve and test.
We don't want to force editors to upload WEBP originals, but we do want to have WEBP images served on the frontend. On some client media websites, we used Fastly, Cloudinary or Cloudflare to achieve basically the same effect.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is also an option to configure the liip imagine to generate WEBP only if it is requested in URL (.webp suffix on original image path) and fall back to original type if webp is not requested. This is what Ibexa does by default with their alias paths, however the downside is that you get double the amount of variation images in the storage, which we do not want. Also we do not intend to have fallback formats as all modern browsers have full WEBP support for the past two years.

Copy link
Member

@iherak iherak Aug 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would we still have a posibility to define different format or from original source format for some filters?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, you can still define desired output format per filter, like in this example
https://symfony.com/bundles/LiipImagineBundle/current/basic-usage.html#client-side-resolving

Also: https://symfony.com/bundles/LiipImagineBundle/current/configuration.html

  • default_filter_set_settings - specify the default values that will be inherit for any set defined in filter_sets. These values will be overridden if they are specified in the each set. In case of filters and post_processors, the specified values will be merged with the default ones.
  • filter_sets - specify the filter sets that you want to define and use.

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

Successfully merging this pull request may close these issues.

3 participants