Renaming Renditions | Community
Skip to main content
November 2, 2015
Solved

Renaming Renditions

  • November 2, 2015
  • 1 reply
  • 934 views

I have implemented an custom DAM Handler to create video image renditions at different parts of the video using FFMpegWrapper.  I need to rename the rendition with the time interval from the still.  When I try to move the rendition an exception occurs saying the rendition node does not exist.  Here is the code:

BufferedImage thumbnail = bufferedImage if(thumbnail != null) { BufferedImage rgbaThumbnail = new BufferedImage(thumbnail.getWidth(), thumbnail.getHeight(), 2) rgbaThumbnail.getGraphics().drawImage(thumbnail, 0, 0, (ImageObserver)null) ThumbnailGenerator generator = new ThumbnailGenerator(asset, rgbaThumbnail) HashSet configs = new HashSet() configs.add(new ThumbnailConfigImpl(weight,height,false)) generator.generate(configs) } Rendition rendition = asset.getRendition("cq5dam.thumbnail."+ weight + "." + height + ".png") rename(rendition, imageName) session.move(rendition.getPath(), rendition.getParent().getPath() + "/" + imageName)
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Lokesh_Shivalingaiah

what is your rename() function doing ??

I think you are trying to access rendition.getPath() after renaming as you have declared variable rendition before rename() and rendition.getPath() might be referring to the old path.

1 reply

Lokesh_Shivalingaiah
Lokesh_ShivalingaiahAccepted solution
November 2, 2015

what is your rename() function doing ??

I think you are trying to access rendition.getPath() after renaming as you have declared variable rendition before rename() and rendition.getPath() might be referring to the old path.