Expand my Community achievements bar.

Force Smart Crops to Generate as JPGs (rather than WEBP)

Avatar

Level 4

We are trying to work around the limitation that you cannot apply Dynamic Media Image Serving and Image Rendering API syntax to Smart Crops.

 

The base use case is that we need to generate large square Smart Crop and then create 5 smaller images from that Smart Crop starting point.  (For clarity, we need a 2000x2000 Smart Crop and then would like to generate a 100x100, 300x300, 500x500 image from that Smart Crop.)  We are working on AEM 6.5, so the AEMaaCS feature to generate multiple Smart Crops in the same aspect ratio is not available to us (and would not work regardless because the client would only want to review/adjust the Smart Crop once and then generate smaller iterations from that starting point, whereas Smart Crops generated in the same aspect ratio are adjusted individually).

 

Adobe does not allow you to add Image Serving API syntax to the Smart Crop URL, or we could just add a wid=100 parameter to adjust the required size.

 

We thought we had a solution by downloading the Smart Crop, creating it as a new asset in AEM and then using Dynamic Renditions from there, but we've found that Smart Crops will often download as WEBP assets (based on the optimization logic in AEM).  WEBP is fine for delivery, but it does not work for our plan, which would require JPGs.  We have been unable to find a Smart Crop setting--either for the image profile or for the Dynamic Media account as a whole--that forces the Smart Crop to use JPGs. (You cannot use the fmt parameter from the Image Serving API syntax--if this were available, we could just use the wid parameter.)

 

Is anyone aware of any way this would be possible?

 

The only workaround we can think of is to use ImageMagick to convert WEBP to JPG, but we'd strongly prefer to avoid another unnecessary conversion if there's any way to have Dynamic Media generate the Smart Crop in the desired file format.

 

Thanks in advance for any suggestions! 

1 Reply