I have a custom rendition created for jpeg image in AEM and programmatically I am trying to get that rendition as a stream.
I can see this rendition exist in the image node, but when I try to get it as input steam , I get null pointer exception.
final Asset asset = DamUtil.resolveToAsset(resource);
InputStream in = asset.getRendition("cq5dam.web.300.300.jpeg").getStream();
Same code works for png rendition.
final Asset asset = DamUtil.resolveToAsset(resource);
InputStream in = asset.getRendition("cq5dam.thumbnail.319.319.png").getStream();
Anyone know why is the difference and why it is failing for jpeg image?
Solved! Go to Solution.
Views
Replies
Total Likes
Please check if that particular rendition is available for that asset by checking via crxde.
Please check if that particular rendition is available for that asset by checking via crxde.
One of the images in the result didn't have the rendition. Thanks @thatsmeadarsh
Views
Replies
Total Likes