thumbnailator icon indicating copy to clipboard operation
thumbnailator copied to clipboard

Rotate Caption / Watermark

Open rider87 opened this issue 4 years ago • 1 comments

Hi,

I want to rotate the text of my Watermark... How is this possible?

Thanks

rider87 avatar Sep 21 '21 13:09 rider87

You could pre-rotate an image and use it as a watermark.

// Pre-rotate image used as watermark.
BufferedImage watermark = Thumbnails.of("/path/to/watermark")
    .size(100, 100)
    .rotate(90)
    .asBufferedImage();

// Use the pre-rotated watermark to make thumbnail
Thumbnails.of("/path/to/image")
    .size(400, 400)
    .watermark(Positions.BOTTOM_RIGHT, watermark, 0.5f);
    .toFile("/path/to/thumbnail")

Generally, watermarks are static, so any kind of processing necessary on the watermark can be performed ahead of time. The watermark methods reflect that common use case.

coobird avatar Sep 21 '21 15:09 coobird

Question answered. Closing for no follow-up activity.

coobird avatar Sep 15 '23 18:09 coobird