Page 1 of 1

How to identify GIF image’s no of layers

Posted: 2018-04-04T09:52:18-07:00
by iashanmugavel
Use case:
In our systsm, user can able to upload all images and it would be converted into different resolutions(thumnail, tiny and medium). We need to validate the images which is having X layers and Y resolutions.

Problem:
While converting GIF images into different resolutions because of high resolutions and more layers our server CPU utilization reaching to 100%.

I dont find any method to validate the number of layers for GIF images.

Identify image.GIF

This is not helping much.

Anyone facing similar issue and found resolutions

Re: How to identify GIF image’s no of layers

Posted: 2018-04-04T12:09:07-07:00
by fmw42
Gif supports frames, not layers. If you mean that then in unix syntax

Code: Select all

identify -format "%n\n" image.gif | head -n 1

Re: How to identify GIF image’s no of layers

Posted: 2018-04-04T13:20:28-07:00
by snibgo
iashanmugavel wrote:... our server CPU utilization reaching to 100%.
By default, IM tries to use as much CPU as it can. You cam limit this with settings in policy.xml. See http://www.imagemagick.org/script/security-policy.php