Jump to content

PSD Files and a web gallery


TheJunior

Recommended Posts

Hello everyone.

I am very new here and I have a problem. I have recently started as a junior IT assistant at a company and I have been asked to make an image gallery by one of the managers of the other departments. I managed to find near enough complete package for free on the internet but it does not support Adobe made files such as PSD (which is photoshop if I am correct). Can someone either point me or give me tips of how or even it is possible I can possibly add this feature to the gallery.

I will put a disclaimer and say that apart from a brief encounter in uni I am very new to php as a whole.

Any help would be much appreciated.

 

Thanks

Link to comment
Share on other sites

Are you wanting to display the actual adobe psd image on a webpage like you can with other image files such as .gif, .png, .jpg files?  You cant as psd's are not actual images supported by web browsers, as it is a proprietary image format owned by Adobe.  However there are converts which can compile the psd into a image that can be used within a webpage.

 

One such converter I found from a simple google search was

http://www.catswhocode.com/blog/php-display-adobe-psd-files-on-a-web-page

 

Maybe try and incorporate that class into your existing PHP script.

Edited by Ch0cu3r
Link to comment
Share on other sites

It is for a web gallery within the company only. Currently it can detect and upload pictures which are put in a specific folder, but it does not recognise psd files at all. Bottom line is yes I would like them to be able to display like jpegs etc but I would also like them to be able to upload as well if that can be done.

Link to comment
Share on other sites

I would also like them to be able to upload as well if that can be done

 

Yes that can be done, without seeing the code I can not tell you specifically what and where you need to edit. Hopefully there is a main config file which will allow you to tell the script what image extensions to include for the upload. if there is no config file then you'll need to find the code responsible for the upload and find where it is filtering out what image files can be uploaded, you'll need to modify it so it includes psd images

 

 

 

Bottom line is yes I would like them to be able to display like jpegs etc

You'll need to use the psdreaderclass I linked to.

Edited by Ch0cu3r
Link to comment
Share on other sites

In plog-includes/plog-functions.php there is this function:

function is_allowed_extension($ext) {
	// return in_array(strtolower($ext), array('jpg', 'gif', 'png', 'bmp', 'mp4', 'wmv'));
	return in_array(strtolower($ext), array('jpg', 'jpeg', 'gif', 'png', 'bmp'));
}
That is probably what you need to modify to allow the psd extension, just add it to the list. That will allow you to upload the files at least, they won't be visible in the browser though unless you make more extensive changes to detect and convert them when uploaded.
Link to comment
Share on other sites

In plog-includes/plog-functions.php there is this function:

function is_allowed_extension($ext) {
	// return in_array(strtolower($ext), array('jpg', 'gif', 'png', 'bmp', 'mp4', 'wmv'));
	return in_array(strtolower($ext), array('jpg', 'jpeg', 'gif', 'png', 'bmp'));
}
That is probably what you need to modify to allow the psd extension, just add it to the list. That will allow you to upload the files at least, they won't be visible in the browser though unless you make more extensive changes to detect and convert them when uploaded.

 

 

What might the more extensive changes include if you do not mind me asking?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.