NGSTACK-901 replace decorator service for variation path generator if Netgen Admin UI is enabled #54
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR replaces original Ibexa webp image variation path generator with our implementation, which generates variation paths compliant with the ones generated in legacy image handler.
The idea is to keep the path patterns in sync, to prevent the storage growth by creating duplicate variations with different paths, depending if they were generated through the Symfony stack or the legacy kernel.
Example:
Original image in JPEG format is uploaded: example.jpg
We want to generate 'medium' image variation in Webp format.
Ibexa variation path generator will produce variation path .../example_medium.jpg.webp
Our class produces path .../example_medium.webp , which matches the path pattern produced with the legacy image handler class.
The generator is replaced only if the NetgenAdminUiBundle is activated on the website. If not (in which case we are using standard Ibexa Admin UI), we will keep the original variation path generator.