Hello, what happens is that I am implementing the Web-Optimized Image Delivery API in my custom components to convert the uploaded assets into webp format.
Use the Adobe Official documentation:
And from the adobe forum with the question:
I implement this into one custom component and it works, but the problem is, I repeat the same solution into another custom components but doesn't works, the curious part is if I just add this part in the code of the sling component:
It breaks all the class inclusive if I only declare the variable and never use it, and it makes fail to all the properties when it should only affect to the fileReference property that is the asset that the user knows.
What could be the cause of this and how could I fix it?
This is the code of my sling model of one of my custom components that I want to add the API to.
Solved! Go to Solution.
Topics help categorize Community content and increase your ability to discover relevant content.
Views
Replies
Total Likes
Hi @Aaron_Dempwolff,
You can consider creating an OSGi service that acts as a “smart proxy” for the AEM-provided AssetDelivery OSGi Service. You can refer to the example code provided here: LINK
Additionally, you can enhance the current implementation of "request.getResourceResolver()" with the injected "ResourceResolver" SlingObject.
@SlingObject
private ResourceResolver resourceResolver;
return getWebOptimizedUrl(resourceResolver, fileReference, options);
Views
Replies
Total Likes
Hi @Aaron_Dempwolff,
You can consider creating an OSGi service that acts as a “smart proxy” for the AEM-provided AssetDelivery OSGi Service. You can refer to the example code provided here: LINK
Additionally, you can enhance the current implementation of "request.getResourceResolver()" with the injected "ResourceResolver" SlingObject.
@SlingObject
private ResourceResolver resourceResolver;
return getWebOptimizedUrl(resourceResolver, fileReference, options);
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies