How do I validate how many images are inside a TIFF file?

Asked

Viewed 53 times

1

I want to do a validation in C# for when to convert a TIFF image to JPEG I can know if all the images have been converted, because TIFF is a single file that sometimes brings several images inside it.

So sometimes I have 10 TIFF that generates 30 JPEG, so to not need to open the TIFF and go counting I wonder if there is a way to know how many images comes in the TIFF without opening.

  • I think this can help you: http://stackoverflow.com/questions/11668945/convert-tiff-to-jpg-format

  • Convert I can, the problem is I validate if it is bringing the right amount of images, because usually it is thousands of images that I convert.

1 answer

2

Using the method Getframecount class Image it is possible to know the number of images contained in the file:

int numeroImagens = Image.FromFile(@"C:\test.tiff").GetFrameCount(FrameDimension.Page);

Browser other questions tagged

You are not signed in. Login or sign up in order to post.