Archiwum

Posty oznaczone ‘Coppermine’

How to use ImageMagick effects with Coppermine

Listopad 29th, 2010 Brak komentarzy

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

Using admin interface isn’t possible because of additional php code so it requires little code editing.

Open include/picmgmt.inc.php file and search for ImageMagick parameters then 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 ImageMagick examples and rebuild your images.