How to use ImageMagick effects with Coppermine

After getting fun with Coppermine Photo Gallery for some time I wanted to achieve polaroid-like effect (using ImageMagick) for thumbnails and intermediate pictures.

The final effect is visible on the picture below.

Open include/picmgmt.inc.php file and search for the ImageMagick's parameters, and just edit it in similar way.

$rand_angle=rand(1,7); // get random angle

$rand_sign=rand(0,1); // - +
if ($rand_sign == 0) { $rand_angle = - $rand_angle; }

$cmd = "{$CONFIG['impath']}convert -quality {$CONFIG['jpeg_qual']} {$CONFIG['im_options']} ".$resize_commands." ".$unsharp_mask." $src_file -bordercolor white -border 6 -bordercolor grey60 -border 1 -background none -rotate {$rand_angle} -background black \( +clone -shadow 60x4+4+4 \) +swap -background white -flatten $im_dest_file";

exec ($cmd, $output, $retval);
For more examples look at the ImageMagick examples and rebuild your images.
Milosz Galazka's Picture

About Milosz Galazka

Milosz is a Linux Foundation Certified Engineer working for a successful Polish company as a system administrator and a long time supporter of Free Software Foundation and Debian operating system.

Gdansk, Poland https://sleeplessbeastie.eu