The result I've posted below. It is very dirty code and obviously cannot be directly incorporated as it is but it might help others who require this functionallity or those who might be interested in developing it.
ImageMagick convert has to be enabled and for simplicity the watermark PNG is the same dimensions as any images to be uploaded.
In the file include/functions_images.inc.php at line 663 (Serendipity 1.3), for uploaded images, I've replaced
Code: Select all
$cmd = escapeshellcmd($serendipity['convert']) . ' -antialias -resize '. serendipity_escapeshellarg($newSize) .' '. serendipity_escapeshellarg($infile) .' '. serendipity_escapeshellarg($outfile);Code: Select all
$cmd = escapeshellcmd('/usr/bin/composite /path/to/watermark/image/watermark.png ') . serendipity_escapeshellarg($infile) . ' miff:- | ' . escapeshellcmd($serendipity['convert']) . ' - -antialias -resize '. serendipity_escapeshellarg($newSize) .' '. serendipity_escapeshellarg($outfile);