Cannot use picture tag with generated DAM renditions

Description

Requirement

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

Code details

Below backend code of the component:

Below generated html:

Description

This was possible by remove in `media/src/main/java/io/wcm/handler/media/impl/MediaBuilderImpl.java`
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?

Activity

Show:
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.
https://wcm.io/handler/media/changes-report.html

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
https://github.com/wcm-io/wcm-io-handler/commit/a7df307db0b48c7537ecdf8eadb2c6d3faafe2fd

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.
Regards

Fixed

Assignee

Stefan Seifert

Reporter

Krzysztof Gorzynski

Labels

None

Components

Fix versions

Affects versions

Priority

Major