TheJunior Posted February 17, 2014 Share Posted February 17, 2014 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 Quote Link to comment https://forums.phpfreaks.com/topic/286265-psd-files-and-a-web-gallery/ Share on other sites More sharing options...
Ch0cu3r Posted February 17, 2014 Share Posted February 17, 2014 (edited) 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 February 17, 2014 by Ch0cu3r Quote Link to comment https://forums.phpfreaks.com/topic/286265-psd-files-and-a-web-gallery/#findComment-1469302 Share on other sites More sharing options...
TheJunior Posted February 18, 2014 Author Share Posted February 18, 2014 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. Quote Link to comment https://forums.phpfreaks.com/topic/286265-psd-files-and-a-web-gallery/#findComment-1469353 Share on other sites More sharing options...
Ch0cu3r Posted February 18, 2014 Share Posted February 18, 2014 (edited) 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 February 18, 2014 by Ch0cu3r Quote Link to comment https://forums.phpfreaks.com/topic/286265-psd-files-and-a-web-gallery/#findComment-1469376 Share on other sites More sharing options...
TheJunior Posted February 18, 2014 Author Share Posted February 18, 2014 I would love to show you the code but there are lots of php scrips and pages in all sorts of different folders. The pre-made gallery is called Plogger and is easily available on the internet. Sorry I cannot be of much more help. Quote Link to comment https://forums.phpfreaks.com/topic/286265-psd-files-and-a-web-gallery/#findComment-1469403 Share on other sites More sharing options...
kicken Posted February 18, 2014 Share Posted February 18, 2014 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. Quote Link to comment https://forums.phpfreaks.com/topic/286265-psd-files-and-a-web-gallery/#findComment-1469405 Share on other sites More sharing options...
TheJunior Posted February 19, 2014 Author Share Posted February 19, 2014 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? Quote Link to comment https://forums.phpfreaks.com/topic/286265-psd-files-and-a-web-gallery/#findComment-1469468 Share on other sites More sharing options...
TheJunior Posted February 19, 2014 Author Share Posted February 19, 2014 Does anyone have a clue as to how I can make the browsers see them as images as this is the last obstacle before I get everything in motion? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/286265-psd-files-and-a-web-gallery/#findComment-1469543 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.