Allow developers to select which image format to use for images in the content - #230
Conversation
mitogh
left a comment
There was a problem hiding this comment.
Minor comment about the code.
Would be great to introduce some tests to test cases like:
- Default behavior
- Reverse behavior
- Empty value
- Unsupported mime types
felixarntz
left a comment
There was a problem hiding this comment.
@eugene-manuilov Looks great, just one comment.
|
Overall looks good although I still prefer to have the filter operate in the opposite order. Also, it would be good to add some tests verifying that the filter works as expected. |
The benefit of how it currently behaves is that the order of how items have to be sorted in the filter itself is arguably more aligned with the other filter, with the "foundational" format coming first (typically JPEG for our purposes currently). The reason we then iterate through the array backwards here is because the "priority order" of the formats would be actually the opposite, which especially makes sense when thinking about it in the context of future
+1 to that, @eugene-manuilov could you add a few tests for the filter usage? |
|
Summary
Fixes #187
Relevant technical choices
Checklist
[Focus]orInfrastructurelabel.[Type]label.no milestonelabel.