Extensions:Watermarking

From Lorekeeper Wiki
Jump to navigation Jump to search
Watermarking
Description Adds support for automatic resizing and watermarking of images uploaded to the masterlist.
Author(s) Mercury
Status Testing
Github watermarking
LK Version Unspecified
Contains a Migration
Is part of LK v2 (modified-main)



Adds the ability to set masterlist images to automatically be resized and/or watermarked on being processed into the masterlist (via image upload, reupload, character creation, design update...) using the Intervention Image package (required by Lorekeeper by default).

By default, the only thing this does is trim images (remove excess transparent space around the edges). Resizing and watermarking are enabled via new values in the site settings admin panel. Resizing is done by scaling the shorter dimension (height/width) to the specified value in pixels. Watermarking is done by placing a set image file in the center of the uploaded image; if both resizing and watermarking are enabled, it resizes first and watermarks second, so take this into account. It does not adjust transparency on the watermark image, but does preserve it. Images may also be saved as different file formats (for example, jpg)-- note however that this may interfere with transparency if not saving as png.

The watermark image itself, meanwhile, can be modified in the site images admin panel. By default it is one of the Lorekeeper default images.

By default, this uses the default behavior for thumbnail processing; the altered behavior can be enabled via the site settings admin panel. Note that for thumbnail generation, the cropping is assumed to fit as much of the character in the square space as possible. If you do not crop images along these lines, the cropping will likely be erroneous-- and, as the need to watermark the image is diminished in the first place, it is recommended you use the default cropping. Design update thumbnails are also generated on image upload, so any design updates with images uploaded before this will not be properly watermarked, if that is desired. This can be resolved by adjusting the crop on the thumbnail image, which will re-process it.

This also adds the ability to store full-sized images (as uploaded to the masterlist) for view by the character's owner and staff with masterlist permissions. This is also disabled by default. If enabled, there is also the option to cap the size of uploaded full-sized images. Full-sized images are referred to via an additional 10-character hash on top of the image's existing hash.

Configuration

Enable resizing, watermarking, and/or thumbnail processing as desired in config/lorekeeper/settings.php. If you enable watermarking, consider uploading a watermark via the site images admin panel.

Usage

Troubleshooting

I can be found in the Lorekeeper server!

See Also