Has one of you ever tried to find out the page count of a multi-page TIFF file usign the CImg library?
I'm trying to calculte the histograms for every single page in the file.
This is my code to load the TIFF file and create an Image object:
#define cimg_use_tiff
#include <CImg.h>
using namespace cimg_library;
void reader::read_tiff(char * filename){
CImg<short> img(filename);
}
I could propably try to use the
CImg<T>::load_tiff (const char *const filename, const unsigned int first_frame=0, const unsigned int last_frame=~0U, const unsigned int step_frame=1)`
function and check if the returned image is null / an exception is thrown. This does not seem like a clean way to to what I want. Any ideas are appreciated!