Expand my Community achievements bar.

Nomination window for the Adobe Community Advisor Program, Class of 2025, is now open!
SOLVED

Renaming Renditions

Avatar

Level 3

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)
1 Accepted Solution

Avatar

Correct answer by
Level 10

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.

View solution in original post

1 Reply

Avatar

Correct answer by
Level 10

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.