Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - image library: how to learn image width and height before loading full image?: (3 Items)
   
image library: how to learn image width and height before loading full image?  
Our application needs to handle both small and large images
on a system with limited memory.

We understand that we can use img_load_resize_file()
to load a subsampled version of the image while using
bounded memory.

But our requirements demand that we either use img_load_resiize()
or img_load_file(), depending on the original width and height
of the image.

Is there a way to determine the properties of the image
(at least width and height), without actually loading the
image, using the QNX image library?  (We cannot load the
image as it may need more memory than available).

Thanks,

Mate
Re: image library: how to learn image width and height before loading full image?  
You can use img_load(). Provide your own img_decode_callouts.setup_f. It will be called with a partially filled img_t. 
The stride and height are the important ones for you, save them, and return IMG_ERR_MEM to stop processing the data.
Once img_load() failed, inspect the saved stride and height.
Re: image library: how to learn image width and height before loading full image?  
Thank you!