# UDF: ImageGetInfo

## Recommended Posts

This UDF is compilation of my previous image UDF's. Regardless of this fact, it's faster because was fully rewrited using DllStruct functions (they are great!) and API read functions. UDF get most usefull information about graphic files - size, color depth, resolution etc. For JPEG files it also retreive various Exif info.

Changes from previous versions:

+ Faster

+ Exif parser seems correct now, so it works fine with the edited images.

+ Much more Exif info retreived.

- Works only with Beta (DllStruct)

Probably it need more error checks, but I think it stable enough. Functionality enough for me and probably most folks, who want use it. Now I'm too bored and not plan make any serious changes until Autoit got native binary handling (if this sometime will be). But feel free to mention about bugs - they are here certainly.

Edit (2007-07-25): updated version to work with latest Autoit.

Edit (2009-01-12): updated attached file to 2.5 version.

Edit (2010-03-18): updated attached file to 2.6 version.

Edit (2010-04-29): updated attached file to 2.7 version.

Edit (2010-10-08): updated attached file to 2.8 version.

image_get_info.zip

image_get_info_30.zip

Edited by Lazycat

##### Share on other sites

Great work. Thanks Lazycat.

An observation: I tested with some pictures and certain image shows incorrectly info with the comments. Perhaps a bug recognizing commentaries. Below, I share the image that showed the error.

##### Share on other sites

Neat.

The other info I would like is if the file is a paletted file (bit depth < 24) then retrieve the color palette table.

I wrote some code a little while back to do this for GIFs, I'll see if I can dig it up...

##### Share on other sites

Great Image UDF.. This will come in handy..

Cheers..

##### Share on other sites

Very nice, I can now delete the 1/2 completed version I have

Start -> Programs -> AutoIt v3 -> AutoIt Help File -> Index -> (The Function you are asking about)----- Links -----DllStruct UDFsRSA Crypto UDFs

##### Share on other sites

Neat.

The other info I would like is if the file is a paletted file (bit depth < 24) then retrieve the color palette table.

I wrote some code a little while back to do this for GIFs, I'll see if I can dig it up...

<{POST_SNAPBACK}>

Found it:

http://www.autoitscript.com/forum/index.ph...color++palette#

##### Share on other sites

i get the following errors.

C:\ImageInfo\image_get_info.au3(48,109) : ERROR: DllStructGetPtr(): undefined function.

$t = DllStructCreate("int;int;short;short;dword;dword;dword;dword, DllStructGetPtr($p, 1)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~^

C:\ImageInfo\image_get_info.au3(48,115) : ERROR: DllStructCreate(): undefined function.

$t = DllStructCreate("int;int;short;short;dword;dword;dword;dword, DllStructGetPtr($p, 1) + 18)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~^

C:\ImageInfo\image_get_info.au3(49,65) : ERROR: DllStructGetData(): undefined function.

_Add($sInfo, "Width, DllStructGetData($t, 1)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\ImageInfo\image_get_info.au3(76,23) : ERROR: DllStructDelete(): undefined function.

DllStructDelete($p) ~~~~~~~~~~~~~~~~~~~~~~^ C:\ImageInfo\image_get_info.au3(133,31) : ERROR: DllStructGetSize(): undefined function. If DllStructGetSize($t)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\ImageInfo\image_get_info_example.au3 - 5 error(s), 0 warning(s)

>AU3Check Ended.

##### Share on other sites

Being fresh new to autoIt I encounter the same problem each time and can't figure out what I am doing wrong. Simply, demos and examples don't work for me and I get errors all the time. For example, I tried this "image_get_info_example.au3" (using Beta+XP) after puting a second copy of "image_get_info.au3" in "C:\Program Files\AutoIt3\beta\Include" and compiles it. I get error.

Thank you

Tuk

Edited by Tukata

##### Share on other sites

This cause latest beta have some changes since this udf was created. Please download fixed version http://www.autoitscript.com/fileman/users/Lazycat/image_get_info.zip.

##### Share on other sites

This cause latest beta have some changes since this udf was created

Well, I uploaded new Beta but still get error.

Local $ret=DllCall("kernel32.dll","int","CreateFile",_ ....Error Error: Error parsing function call. Thank you Tuk #### Share this post ##### Link to post ##### Share on other sites Well, I uploaded new Beta but still get error. Local$ret=DllCall("kernel32.dll","int","CreateFile",_ ....Error

This version is fixed.

##### Share on other sites

great work !!

i suggest you add a pixelgetcolor function so that it can be retrieved

without dispalying the image.

this would be very usefull

##### Share on other sites

This UDF is compilation of my previous image UDF's. Regardless of this fact, it's faster because was fully rewrited using DllStruct functions (they are great!) and API read functions. UDF get most usefull information about graphic files - size, color depth, resolution etc. For JPEG files it also retreive various Exif info.

Changes from previous versions:

+ Faster

+ Exif parser seems correct now, so it works fine with the edited images.

+ Much more Exif info retreived.

- Works only with Beta (DllStruct)

Probably it need more error checks, but I think it stable enough. Functionality enough for me and probably most folks, who want use it. Now I'm too bored and not plan make any serious changes until Autoit got native binary handling (if this sometime will be). But feel free to mention about bugs - they are here certainly.

Hi,

jpg images are only returning x & Y resolution and resolution unit. Gif images are returning information fine. I downloaded the latest udf from the last link.

Any ideas?

tif images are fine also

[/edit]

Edited by billmez

##### Share on other sites

wow, me likey.

It tells me all my cam stats cool

[center]AutoIT + Finger Print Reader/Scanner = COOL STUFF -> Check Out Topic![/center][center][font=Arial Black]Check out ConsultingJoe.com[/font][/center][center]My Scripts~~~~~~~~~~~~~~Web Protocol Managing - Simple WiFi Scanner - AutoTunes - Remote PC Control V2 - Audio SpectrascopePie Chart UDF - At&t's TTS - Custom Progress Bar - Windows Media Player Embed[/center]

##### Share on other sites

Very nice UDF.

Any plans on adding Write functionality?

## Create an account

Register a new account