Unable to process image [.tiff] which contains two or multi pages

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
sanjaysurve
Posts: 3
Joined: 2015-03-05T06:50:07-07:00
Authentication code: 6789

Unable to process image [.tiff] which contains two or multi pages

Post by sanjaysurve »

Hi,

I am successfully resizing images using imagemagick.

But when i am trying to manipulate or resize image [.tiff format] which contains two or more pages then its not processing properly.

If any one have an idea about the same. Please advice.

Thanks in advance.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Unable to process image [.tiff] which contains two or multi pages

Post by snibgo »

If your input file has two (or more) images, you will get two (or more) outputs. If your output format is tiff, that will be no problem.

If you want to process just one input from a tiff, use [n] where n is an integer from zero upwards, eg:

Code: Select all

convert in.tiff[2] -resize 200x300 out.png
snibgo's IM pages: im.snibgo.com
sanjaysurve
Posts: 3
Joined: 2015-03-05T06:50:07-07:00
Authentication code: 6789

Re: Unable to process image [.tiff] which contains two or multi pages

Post by sanjaysurve »

snibgo wrote:If your input file has two (or more) images, you will get two (or more) outputs. If your output format is tiff, that will be no problem.

If you want to process just one input from a tiff, use [n] where n is an integer from zero upwards, eg:

Code: Select all

convert in.tiff[2] -resize 200x300 out.png
Hi snibgo, thanks for quick reply.

Your provided information is helpful for me.

But if I don’t know how many pages/slides contains under [.tiff] image then is it possible to fetch information about same.
For example, suppose user submitted one [.tiff] image which contains more than two or more pages/slides. Then how I will come to know number of pages/slides in image.

Once again thanks.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Unable to process image [.tiff] which contains two or multi pages

Post by snibgo »

Code: Select all

identify -format %n x1.tiff

11

identify x1.tiff

x1.tiff[0] TIFF 4924x7378 4924x7378+0+0 16-bit sRGB 1.1448GB 0.000u 0:00.000
x1.tiff[1] TIFF 4924x7378 4924x7378+0+0 16-bit sRGB 1.1448GB 0.000u 0:00.045
x1.tiff[2] TIFF 4924x7378 4924x7378+0+0 16-bit sRGB 1.1448GB 0.000u 0:00.045
x1.tiff[3] TIFF 4924x7378 4924x7378+0+0 16-bit sRGB 1.1448GB 0.000u 0:00.061
x1.tiff[4] TIFF 4924x7378 4924x7378+0+0 16-bit sRGB 1.1448GB 0.000u 0:00.061
x1.tiff[5] TIFF 4924x7378 4924x7378+0+0 16-bit sRGB 1.1448GB 0.000u 0:00.061
x1.tiff[6] TIFF 4924x7378 4924x7378+0+0 16-bit sRGB 1.1448GB 0.000u 0:00.077
x1.tiff[7] TIFF 4924x7378 4924x7378+0+0 16-bit sRGB 1.1448GB 0.000u 0:00.077
x1.tiff[8] TIFF 4924x7378 4924x7378+0+0 16-bit sRGB 1.1448GB 0.000u 0:00.077
x1.tiff[9] TIFF 4924x7378 4924x7378+0+0 16-bit sRGB 1.1448GB 0.000u 0:00.077
x1.tiff[10] TIFF 4924x7378 4924x7378+0+0 16-bit sRGB 1.1448GB 0.000u 0:00.092
Does that help?
snibgo's IM pages: im.snibgo.com
sanjaysurve
Posts: 3
Joined: 2015-03-05T06:50:07-07:00
Authentication code: 6789

Re: Unable to process image [.tiff] which contains two or multi pages

Post by sanjaysurve »

snibgo wrote:

Code: Select all

identify -format %n x1.tiff

11

identify x1.tiff

x1.tiff[0] TIFF 4924x7378 4924x7378+0+0 16-bit sRGB 1.1448GB 0.000u 0:00.000
x1.tiff[1] TIFF 4924x7378 4924x7378+0+0 16-bit sRGB 1.1448GB 0.000u 0:00.045
x1.tiff[2] TIFF 4924x7378 4924x7378+0+0 16-bit sRGB 1.1448GB 0.000u 0:00.045
x1.tiff[3] TIFF 4924x7378 4924x7378+0+0 16-bit sRGB 1.1448GB 0.000u 0:00.061
x1.tiff[4] TIFF 4924x7378 4924x7378+0+0 16-bit sRGB 1.1448GB 0.000u 0:00.061
x1.tiff[5] TIFF 4924x7378 4924x7378+0+0 16-bit sRGB 1.1448GB 0.000u 0:00.061
x1.tiff[6] TIFF 4924x7378 4924x7378+0+0 16-bit sRGB 1.1448GB 0.000u 0:00.077
x1.tiff[7] TIFF 4924x7378 4924x7378+0+0 16-bit sRGB 1.1448GB 0.000u 0:00.077
x1.tiff[8] TIFF 4924x7378 4924x7378+0+0 16-bit sRGB 1.1448GB 0.000u 0:00.077
x1.tiff[9] TIFF 4924x7378 4924x7378+0+0 16-bit sRGB 1.1448GB 0.000u 0:00.077
x1.tiff[10] TIFF 4924x7378 4924x7378+0+0 16-bit sRGB 1.1448GB 0.000u 0:00.092
Does that help?
Ok. Yes this will works for me.

Thanks snibgo.. 8)
Post Reply