TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: kraz on March 28, 2012, 10:49:37 PM

Title: [Help]Get Image Tag(EXIF)
Post by: kraz on March 28, 2012, 10:49:37 PM
Hello Swamps~~

I want to get tag attribute from jpg image.
some jpg image has tags(EXIF).
In my opinion, I'll need some activex library.

Thanks in advance...
Title: Re: [Help]Get Image Tag(EXIF)
Post by: irneb on March 29, 2012, 10:28:17 AM
Can't readily find any such thing for a late-binding ActiveX library (only OCX components to place on VB forms). However, there's an example using DotNet: http://msdn.microsoft.com/en-us/library/xddt0dz7.aspx
Title: Re: [Help]Get Image Tag(EXIF)
Post by: kraz on March 29, 2012, 10:37:24 AM
Can't readily find any such thing for a late-binding ActiveX library (only OCX components to place on VB forms). However, there's an example using DotNet: http://msdn.microsoft.com/en-us/library/xddt0dz7.aspx


thanks for ur link...but i can't understand... :cry:
Title: Re: [Help]Get Image Tag(EXIF)
Post by: irneb on March 31, 2012, 05:59:19 AM
Sorry ... I don't either  :lmao: .  Just kidding!  >:D I meant that you'd need to create something like this in VB.Net/C# - there are ways to then have it interoperate with lisp.

I've done some more googling, it seems there is an OpenSource one: SImage (http://www.reneris.com/tools/default.asp). Basically it's a DLL which you'll need to register using a windows command-line (CMD console):
Code: [Select]
regsrv32 SImageUtil.dllThereafter you can use
Code: [Select]
(vlax-get-or-create-object "SImageUtil.Image")To obtain a link to this utility. Then the normal vlax-get/put/invoke methods should work.

I haven't tested it myself, but from the documentation (http://www.reneris.com/tools/iusage.asp#Image.GetExif%28%29) it does have a GetExif & DumpExif method.
Title: Re: [Help]Get Image Tag(EXIF)
Post by: kraz on March 31, 2012, 09:02:18 AM
Sorry ... I don't either  :lmao: .  Just kidding!  >:D I meant that you'd need to create something like this in VB.Net/C# - there are ways to then have it interoperate with lisp.

I've done some more googling, it seems there is an OpenSource one: SImage (http://www.reneris.com/tools/default.asp). Basically it's a DLL which you'll need to register using a windows command-line (CMD console):
Code: [Select]
regsrv32 SImageUtil.dllThereafter you can use
Code: [Select]
(vlax-get-or-create-object "SImageUtil.Image")To obtain a link to this utility. Then the normal vlax-get/put/invoke methods should work.

I haven't tested it myself, but from the documentation (http://www.reneris.com/tools/iusage.asp#Image.GetExif%28%29) it does have a GetExif & DumpExif method.


thanks irneb
but it doesn't support GPS coordinates....anyway thanks a lot
Title: Re: [Help]Get Image Tag(EXIF)
Post by: irneb on March 31, 2012, 10:49:24 AM
Sorry that it doesn't work in your case. Perhaps some other might do. The Google search terms I used was
Quote
vbscript exif
Since vbscript usually uses ActiveX late-binding libraries, it usually gives the best results for searching ActiveX creatable objects.

An alternative would be to study up on the Exif spec (http://www.exif.org/specifications.html). (also http://www.media.mit.edu/pia/Research/deepview/exif.html) I.e. figure out exactly how to read the Exif data in its raw format from the file. The problem here is that lisp doesn't have a binary file utilities. I've come across another thread previously where Lee Mac has created a lisp which does read the binary values into lists of integers though, perhaps that might suffice: http://www.theswamp.org/index.php?topic=39814.0

He's basically using the ADODB.Stream ActiveX library to read the file and return the binary codes from it. Thus you can then search such list for the relevant start position of the Exif marker inside the JPG (0x8825 = (136 37)). That would be followed by a byte showing the length of the field (in it's entirety including the 2 bytes for marker & size). Then followed by the data itself.
Title: Re: [Help]Get Image Tag(EXIF)
Post by: kraz on April 01, 2012, 02:32:16 AM
Sorry that it doesn't work in your case. Perhaps some other might do. The Google search terms I used was
Quote
vbscript exif
Since vbscript usually uses ActiveX late-binding libraries, it usually gives the best results for searching ActiveX creatable objects.

An alternative would be to study up on the Exif spec (http://www.exif.org/specifications.html). (also http://www.media.mit.edu/pia/Research/deepview/exif.html) I.e. figure out exactly how to read the Exif data in its raw format from the file. The problem here is that lisp doesn't have a binary file utilities. I've come across another thread previously where Lee Mac has created a lisp which does read the binary values into lists of integers though, perhaps that might suffice: http://www.theswamp.org/index.php?topic=39814.0

He's basically using the ADODB.Stream ActiveX library to read the file and return the binary codes from it. Thus you can then search such list for the relevant start position of the Exif marker inside the JPG (0x8825 = (136 37)). That would be followed by a byte showing the length of the field (in it's entirety including the 2 bytes for marker & size). Then followed by the data itself.

your advice is very helpful for me...thanks irneb. you are very nice... :wink:
Title: Re: [Help]Get Image Tag(EXIF)
Post by: irneb on April 02, 2012, 08:15:03 AM
Pleasure!