Archiwum

Posty oznaczone ‘Zen Photo’

Cool JavaScript effects

Grudzień 5th, 2010 Brak komentarzy

It looks like developing Zen Photo plugin to add ImageMagick effects is now not possible and due to cpu/memory constraints it will be (very likely) not possible in the future.

Hopefully I was pointed out quite interesting solution. Just check out CVI-Projects site. It contains many JavaScript effects ready to download with useful examples.

Eventually if you are interested in this topic jump directly to forum post or ticket.

Zen Photo – Polaroid-like effect

Grudzień 4th, 2010 Brak komentarzy

Hopefully it is the last time I try to achieve such effect as I am switching gallery to Zen Photo so lets see result at first:

I don’t know how to write plugin for Zen Photo yet (which hook should I use?) so lets edit source.

Open zp-core/lib-Imagick.php file and search for function zp_imageOutput. It should end with line:

return $bg->writeImages($filename, true);

Replace it with code:

$im->borderImage("white", 5, 5);
$im->borderImage("grey60", 1,1);
 
$shadow=$im->clone();
$shadow->setImageBackgroundColor( new ImagickPixel( 'black' ) );
$shadow->shadowImage( 60, 4, 4, 4 );
 
$shadow->compositeImage( $im, Imagick::COMPOSITE_OVER, 0, 0 );
$bg = $shadow->clone();
$bg->colorFloodFillImage("white", 100, '#777777', 0, 0);
$bg->compositeImage($shadow, Imagick::COMPOSITE_OVER, 0, 0);
$bg->flattenImages();
 
// wrong place - should be for $im not $bg
$d = $bg->getImageGeometry();
$w = $d['width'];
$h = $d['height'];
$amplitude = $w * 0.01;
$wavelength = $h  * (rand(5) + 5);
$bg->rotateImage("white",90);
$bg->waveImage($amplitude, $wavelength);
$bg->rotateImage("white",-90);
 
$rand_angle=rand(1,7); // get random angle
 
$rand_sign=rand(0,1); // - +
if ($rand_sign == 0) { $rand_angle = - $rand_angle; }
$bg->rotateImage("white",$rand_angle);
 
return $bg->writeImages($filename, true);

At least for some time problem is solved so code could be later used to create plugin.

Articles that I used to achieve this effect in Zen Photo includes whole (great!) Mikko’s blog and
Imagick: Maintain (fake) transparency when saving as JPEG.

Zen Photo and Nginx – rewrite rules

Grudzień 3rd, 2010 Brak komentarzy

If you are using Zen Photo and searching for Nginx rewrite rules then just jump directly to http://wiki.nginx.org/ZenPhoto.