It’s not usually possible to display Adobe PSD files in a web page. But there are times when such display becomes a need. And it is possible to make such a display quite easily with the help of a PHP class. Here’s how it goes -
1. Download the classPhpPsdReader.php – The class is written by Tim de Koning. It can be used to open images in the PhotoShop PSD format. It creates a GD true color image and renders the image read from a PhotoShop image file. A function named imagecreatefrompsd() is provided to simplify the creation of images from PhotoShop files using this class.
2. Unzip and upload the php file on your server.
3. Here’s an example of the code for displaying -
<?php // Send header to client browser header("Content-type: image/jpeg"); // Includes the requested class include_once('classPhpPsdReader.php'); // Finally display the PSD on the screen imagejpeg(imagecreatefrompsd('yourPsdFile.psd')); ?>
Thats it! You are all set to display Adobe PSD files in your website.