Generate psd thumbnails with php_PHP tutorial

WBOY
Release: 2016-07-13 17:43:58
Original
1078 people have browsed it

1.psd file is in the file format of Photoshop and cannot be displayed directly by the browser. There is a need to generate a preview of the psd file. I searched on Google for a few days but could not find the available code, so I researched it myself and finally found it. The solution is to export the psd to a jpg file first and then generate a thumbnail of it, it will be much easier.

2. You need to use an open source library of PHP: imagemagick. Installation method: Search "ImageMagick php windows installation" in Google. Of course, if you are Linux, just replace Windows with Linux.

3. After installation, the key is how to use it. After a few hours of tossing, the conversion was finally achieved. It is very simple:

$mw= NewMagickWand();
MagickReadImage($mw, 123.psd);
MagickResetIterator($mw);
MagickWriteImage($mw, "123.jpg");


www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/478782.htmlTechArticle1.psd file is in Photoshop file format and cannot be displayed directly by the browser. There is a need to generate a psd file. Preview image, I couldn’t find any usable code after searching on Google for a few days, so I researched it myself...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!