Finding a picture size ...

Blitz3D Forums/Blitz3D Programming/Finding a picture size ...

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Usually in the file header most image files have an 'id' or 'magic number' to confirm that it truly is a jpg/tif/tga/png etc, often in the first couple of bytes.

I've written some code for reading in uncompressed TIFFs and TGAs - most file formats are easy enough to read if they're uncompressed or compressed with a fairly simple method like RLE.

Also in the header they always contain a reference to the width and height and of an image along with lots of other information.

Have a look on google under 'jpg file specification' or similar. Reading the header is usually pretty easy.