Reading image information without LoadImage

BlitzMax Forums/BlitzMax Programming/Reading image information without LoadImage

BlitzSupport(Posted 2009) [#1]
For anyone who doesn't check the Code Archives much, I'm quite proud of this! It lets you read width/height/depth and some other information directly from image files without having to load the whole file via LoadImage first:

Retrieve image information without loading entire image

It currently supports BMP, PNG, JPEG and Gif formats. [EDIT: Now supports TGA.]


Nate the Great(Posted 2009) [#2]
nice job... In fact, I think I might need this for a little project of mine.


impixi(Posted 2009) [#3]
Yes, very useful, James. Thanks.


ImaginaryHuman(Posted 2009) [#4]
Nice, useful for paint programs and the like.


Bremer(Posted 2009) [#5]
Thank you for sharing. I have sent you some code to get values (width,height,depth) from TGA files.


BlitzSupport(Posted 2009) [#6]
Thanks, Zawran, but I've just been adding TGA -- see updated entry!


Bremer(Posted 2009) [#7]
Ah, too late then. I took a quick look at .tiff, but it looks a bit more complex. I might take a closer look during the weekend though.


BlitzSupport(Posted 2009) [#8]
This code now supports online images too, ie. pass a URL and you get the width/height/other information back, again without having to read the whole image.

Not sure what actual use that is, but it's very cool.


Armitage 1982(Posted 2009) [#9]
Nice !!
Very useful for image editing and other image related tool.

Thanks for this addition :)


BlitzSupport(Posted 2009) [#10]
I've just fixed it for PPC Macs -- as I suspected, I needed to fix the byte-endianness.