Retina Support
-
I am using the Image Watermark plugin, version 1.5.1, in combination with the WP-Retina 2x plugin. Unfortunately Image Watermark does not support Retina images – one could possibly argue that either WP should have basic Retina support and/or the WP-Retina 2x plugin should register Retina images. In any case, I’ve added a simple code snippet to image-watermark.php that checks for the existence of a Retina (@2x) version of the image and applies the watermark to that as well. Perhaps it is somewhat of a dirty ‘hack’, but it works for my workflow:
- Upload image,
- Generate Retina images,
- Manually apply watermark.
-
Code snippet (place after line 986 in image-watermark.php):
// check for retina $filepath_retina = $upload_dir['basedir'] . DIRECTORY_SEPARATOR . dirname( $data['file'] ) . DIRECTORY_SEPARATOR . basename( $data['sizes'][$image_size]['file'], '.' . pathinfo( $data['sizes'][$image_size]['file'], PATHINFO_EXTENSION ) ) . '@2x.' . pathinfo( $data['sizes'][$image_size]['file'], PATHINFO_EXTENSION ); if( file_exists( $filepath_retina ) ) { $this->do_watermark( $filepath_retina );Of course, one could conceive a setup where all Retina/HDPI images are checked for, i.e., @1.5x, etc. and that this is a configurable option.
The topic ‘Retina Support’ is closed to new replies.