Page 1 of 1

If the PSD file,layers too much

Posted: 2015-12-22T02:22:14-07:00
by Medina
My English is not good,
I was using the Google translation,
I do not know whether to read.
In the process of using ImageMagick,
If the PSD file,layers too much,
will be unable to generate JPG thumbnails,
How to solve this problem,
there is no other better way? :(
We are expecting a reply :D .

Re: If the PSD file,layers too much

Posted: 2015-12-22T03:38:14-07:00
by Bonzo
Not quite sure what you mean but posting your code and an example file may help.

With psd files you can work with different layers e.g. input.psd[0] will work with layer one which should be the combination of all the layers.

Re: If the PSD file,layers too much

Posted: 2015-12-22T05:55:53-07:00
by Medina
Bonzo wrote:Not quite sure what you mean but posting your code and an example file may help.

With psd files you can work with different layers e.g. input.psd[0] will work with layer one which should be the combination of all the layers.
I give you an example tomorrow.
I am now in the evening time.

Re: If the PSD file,layers too much

Posted: 2015-12-22T05:56:32-07:00
by Medina
Bonzo wrote:Not quite sure what you mean but posting your code and an example file may help.

With psd files you can work with different layers e.g. input.psd[0] will work with layer one which should be the combination of all the layers.
thanks

Re: If the PSD file,layers too much

Posted: 2015-12-22T10:45:01-07:00
by fmw42
What do you mean by "layers too much"? Do you mean you have too many layers? Do you only want to output just a few layers? If so, use the [0,1,2-4] syntax. See "selecting frames (layers or pages)" at http://www.imagemagick.org/script/comma ... essing.php

Re: If the PSD file,layers too much

Posted: 2015-12-22T17:59:58-07:00
by Medina
fmw42 wrote:What do you mean by "layers too much"? Do you mean you have too many layers? Do you only want to output just a few layers? If so, use the [0,1,2-4] syntax. See "selecting frames (layers or pages)" at http://www.imagemagick.org/script/comma ... essing.php
For example,which contains more than 300 layers,a PSD file.Could not generate JPG thumbnail.(Specifically,I have no test of how many layers)

I use the following code

Code: Select all

$img     = "uploads/2015-12-22/9edc3b47ffcef19dfce3d1c669949b8d.psd";
$yimg    = "uploads/2015-12-22/9edc3b47ffcef19dfce3d1c669949b8d.jpg";
$im = new Imagick($img);
$im->setIteratorIndex(0);
$im->setImageCompressionQuality(100); //Picture quality
$im->writeImage($yimg);

Re: If the PSD file,layers too much

Posted: 2015-12-22T19:25:34-07:00
by fmw42
You can find out how many layers by parsing

Code: Select all

identify image.psd
It will list out each layer and you can count them.

Are you running out of memory? Do you have enough to hold twice the size of your input psd file?

Re: If the PSD file,layers too much

Posted: 2015-12-22T20:28:09-07:00
by Medina
I've been testing for a long time, and it's not a question of memory.
I'm sure more than a certain number of layers after.
Unable to properly generate JPG me test how many layers in the end after more than.

Translation tool really hurt egg:(

Re: If the PSD file,layers too much

Posted: 2015-12-22T20:41:33-07:00
by fmw42
Does it work for psd with less than 300 layers? If so, how many can you do at most? What is the file size of your psd?

What is your Imagemagick version and platform?

What do you get from

Code: Select all

convert -version
Does it contain jpg or jpeg in the Delegates? If so, what version of libjpeg?

Re: If the PSD file,layers too much

Posted: 2015-12-23T00:13:19-07:00
by Medina
Memory problems, multi-layer memory usage on the increase.
Thank guys