Best way to flatten layers from php library

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Posts: 1
Joined: 2019-03-14T04:57:10-07:00
Authentication code: 1152

Best way to flatten layers from php library

Post by oscar.ruz »


I'm developing a web site to manage images. In this site included an image library for that the users uploads permitted images files(jpg, tiff and psd) and the server creates a low resolution image.

Then I have a problem with the files with layers(tiff and psd). I have used a simple code to merge the layers using the function: mergeImageLayers with the constant(LAYERMETHOD_FLATTEN). Using this the 80% of the files creates a good low resolution but the another 20% not :(

For example when it uploaded a psd/tiff file with touch-up color layer show an error with Internal Server Error bla bla bla...

I need help with this files. Which is the best way to solved this issue?


User avatar
Posts: 26383
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Best way to flatten layers from php library

Post by fmw42 »

Please post a link to one of your problem images.

Please, always provide your IM version and platform when asking questions, since syntax may differ.

Also provide your exact command line and your images, if possible.

See the top-most post in this forum "IMPORTANT: Please Read This FIRST Before Posting" at ... f=1&t=9620

If using Imagemagick 7, then see

For novices, see ... f=1&t=9620 ... essing.php