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?