GreycLab/CImg

[Question] Get image header without load the whole image.

Closed this issue · 4 comments

Hi,

Is it possible to use CImg to get the image header (e.g., width, height, pixel type) without loading the actual data by calling load function?

Thanks,

Han

No, I don't think so.
Maybe a simple fread() would do the job in this case, no ?

Problem is that I have to do that for at least jpg, png, tif, exr, so I think a library with unified interface is better.

I see. I don't think CImg will help you reading only the headers.
Maybe you could check the Magick++ library for that case.

In fact I have used GDAL for that. The reason I'm looking into CImg first, is because its simplicity, rather than a heavy library.