Jumlins TechBlog

The coding hell and the daily IT of Niklas Jumlin

January 19th, 2010

So i was troubled with how to open and display a psd file with PHP’s imagick component.

I came to the following result, apparently imagick imports all the layers, and by using the image iterator, you can go through them.
The iterator index 0 is the whole image merged together.

By using this simple code, notice the setIteratorIndex(), i succesfully displayed a few multilayered psd files.

<?php
// *********************
// *   Developed by:   *
// * Gofolo Consulting *
// *  www.gofolo.com   *
// *********************
$im = new Imagick('Visitkort_Ver1.psd');
$im->setIteratorIndex(0);
$im->setImageFormat('png');
 
header("Content-Type: image/png");
echo $im;
?>
January 5th, 2010

So I work with many servers and many customers. Usually I had to write a new backup script for every new customer and server. Therefore I figured I might as well just write a template that I can copy/paste everytime I have to implement a robocopy backup script. So here goes.

Read the rest of this entry »