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

I want to do a validation in C # for when converting an image from TIFF 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 have to open the TIFF and go counting I would like to know if there is a way to know how many images comes in the TIFF without opening.

Author: Julianno, 2017-01-25

1 answers

Using the method GetFrameCount of the 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);
 2
Author: communicative, 2017-06-01 06:08:22