[RESPDAM-15] Image MIME type read from node name Created: 18/Jun/19  Updated: 14/Feb/22  Resolved: 25/Jul/19

Status: Closed
Project: DAM Focal
Component/s: None
Affects Version/s: 1.1
Fix Version/s: 1.1.4

Type: Bug Priority: Major
Reporter: Chris Jennings Assignee: Adrien Manzoni
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0d
Time Spent: 1h
Original Estimate: Not Specified

Attachments: Text File IllegalStateException.txt    
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:

 Description   

When an image is uploaded to the DAM, its MIME type is saved as the property jcr:mimeType on the binary node. Similarly the file name is saved as @fileName and the extension as @extension.

However, when rendering a resized image, getOutputformat() of the class info.magnolia.dam.imaging.responsive.ui.imaging.ResponsiveImageOperationChain parses out the extension of the asset node's name which is assumed to be the name of the originally uploaded asset.

This is very brittle and means that when the node name is something other than a filename with an extension the resizing process fails, resulting in the error:

 

 

java.lang.IllegalStateException: untitled has no known entry in MIMEMapping
info.magnolia.imaging.AbstractImageStreamer.getMediaType(AbstractImageStreamer.java:51)
info.magnolia.imaging.DefaultImageStreamer.serveImage(DefaultImageStreamer.java:64)
 

 



 Comments   
Comment by Adrien Manzoni [ 23/Jul/19 ]

Hi chris.jennings

This should be fixed with that version

<!-- DAM focal --> 
<dependency> 
  <groupId>info.magnolia.dam</groupId> 
  <artifactId>magnolia-dam-images-responsive</artifactId> 
  <version>1.1.4</version> 
</dependency>
Generated at Mon Feb 12 00:41:41 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.