Cannot use picture tag with generated DAM renditions



We want to use HTML picture tag to display DAM renditions.

Code details

Below backend code of the component:

Below generated html:


This was possible by remove in `media/src/main/java/io/wcm/handler/media/impl/`
checking `ensureMediaFormatHasRatio()`

If we add ratio to the builder the connection to DAM will be lost and every rendition will be generated on the fly and pointed under /content/... path, what is not expected from Caching Strategy point of view - if image in DAM will be changed then instead of invalidating one path in DAM we need to invalidate many under /content.

Proposed solution:

Could you add some way to skip ratio validation? Or we should implement our requirements differently?


Stefan Seifert
June 3, 2019, 8:34 PM

which version of the media handler are you using? in the very latest version (1.5.0) we implement several improvements around media formats without having a fixed ratio.

Krzysztof Gorzynski
June 3, 2019, 8:37 PM

We are using exactly 1.5.0.
Apologize, it was not available to set in the ticket select box.

Stefan Seifert
June 3, 2019, 8:58 PM

ok, i understand.

revisiting the code it think with the improvements from release 1.5.0 there is no longer any need to allow only media formats with a ratio for picture sources - i've removed this check in version 1.5.1-SNAPSHOT

does this solve your issue?

btw, for your simple usecase having the same media format for all breakpoints consider using "imageSizes" instead for "pictureSource" for the repsonsive image handling.

Krzysztof Gorzynski
June 3, 2019, 10:29 PM

Thank you, this should solve my issue. The example code is just simply starting point, I think it will be more and more requirements soon.



Stefan Seifert


Krzysztof Gorzynski




Fix versions

Affects versions