SOLVED: Gif, Jpg, Pcx, Png, WBmp, BmpOs2 Header Image Size reading

  • 12 years ago

    [quote]Hi do you someone have function like this. I don't want to read all images with Image.FromFile, because I suppose with reading headers, dependent on extension may be faster. ? I suffice with universal function reading image size of file. Thx for reply.[/quote]

    Here is source code. If you want to check out my wallpaper rotation system, which implements it, download wallpi. It is 20kb, no installation and fully freeware.

    For source code of any of my app please write email Yes

  • 12 years ago

    Updated: JFIF routine improved for SOF2, and not only SOF0 when they are equal (I suppose that also for SOF3 and 1, but where to get jpeg samples for that :). Also (what I am proud of) I created whole Exif.GetSize function which can supply JFIF if missing. Also I have put important information sources into functions derived from them. If you have some exotical imaging system I will welcome your jpg file samples. Enjoy.

    Note: if you want to quickly understand Exif IFD tagging architecture, read short piece of TIFF documentation about IFD, from, and Exif specification after that. You spare few hours of being confused. Tiff doc is better written, while Exif, derived from Tiff has confusing and sometimes fairly scaring passages Wink

  • 12 years ago

    Thanks for the contribution :-) I'm sure that there are many who will find this useful.

  • 12 years ago

    I guess so. It is strange that noone did a good job in "explaining" concrete format architectures over the web. You just must consume 3-7 documents about selected architecture (if it is not bmp Smiley Face), and exclude another 5-10 irrelevant documents, to juice out knowledge "After checking you are on Tiff header (which starts two bytes after "Exif" bytes and is header of Exif) you find pointer to first exif partition (IFD) at eight position, seek, you get number of 12-byte tag records in current IFD, first bytes of tag is ID of "name" of "value", then goes record type, then goes 4-byte pointer to value anywhere in After-Tiff section (absolute to start of Tiff header), which, if record type fits 4 bytes is not pointer but directly stored tag value. Every IFD contains tag refering to next IFD in absolute scale starting from tiff header start. (To get to Tiff header correctly find application marker xE1 in jpeg's xFF partitions).

    I think all the filetype info all around is very hard to use. It should at least contain some examples in C, and also it should be divided to "Short understand", "Long understand" every internal system and then Tables sections which are too concrete to be placed in "system of" text. All which I found about Jpeg, Exif and Jfif are examples of exactly informing but not very usable(friendly) documents. For example I was turning exif pdf up - down around to find where are tags stored and how to get to them for some hours, and after guessing, that if tiff header is used in exif, I should read about IFD (importancy of IFD only I understanded from exif.pdf at moment) in tiff.pdf. I scrolled to tiff IFD section, read 1-2 paragraphs and I could return to Exif document with full knowledge of what to search and how in exif.pdf.

     But maybe I would want folder-book for teaching diferencial math. Smiley Face who knows.

  • 12 years ago

    Ok, for who just using this source ImageInfo for anything. Download it again. There is updated section of PNG reading size. As I was rewriting code to "Endianed" I set PNG uint64 reading to BigEndian from correct position. You can also correct it manually. Just that two enums in GetInfo sub in case "PNG" switch to littleEndian.

Post a reply

Enter your message below

Sign in or Join us (it's free).


Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Every language has an optimization operator. In C++ that operator is ‘//’”