Get exif data from file

Anyone know how to get exif data from an image file?

apologies for the duplicate. i received an error message and thought it had not gone through…

Yes… it requires a command line utility the you can call from SHELL
I’m on my way out to an appointment… but will post the particulars when I return

Thank you Dave.

Here is where you can get the command line utility (it is free) EXIF tool

here is a chunk of code that uses it… NOTE : this is pulled right out of one of my projects and no attempt was made to make it generic… so you will have to do some work to make it fit your needs

link sample code

references to GALLERY in the code is an array of photographs…

Thanks.

Using the EXIF Tool means … no sandboxing. :slight_smile:

MBS plugins can do this too (and more).

Dave, what is ‘sips_format’?

[quote=26959:@Christophe De Vocht]Using the EXIF Tool means … no sandboxing. :slight_smile:

MBS plugins can do this too (and more).[/quote]
Also on windows ?

SIPS is an OSX included utility that also manipulates images…
scriptable image processing system.

the app I cut that code out of detected if SIPS and/or EXIF apps were available and did or did not do certain things based on that.
For example… if SIPS were there and EXIF were not… it “faked” certain data that EXIF would also have provided (but a VERY limited subset)

Okay. Thanks.

Some of this is new territory for me. How do I add the second Constructor for the exif class?

If you’re Mac only, then the tools for manipulating TIFF/EXIF/IPTC data is already included as part of Apple’s ImageIO kit. Take a look at CGImageProperties, if you own the MBS plugin, it already has the functions included if not, then check the MacOSLib (I’m not sure if it has it or not). Otherwise if you’re familiar with declares and Cocoa you can access it directly.

If you want x-plat or Windows… I might be able to help you.

Dave, I’m working through the code, but getting a little confused. Could you give me an example of how you would get exif data from within an applicaiton? What method/methods do you call?

I guess you have to use the shell to call the Exif tool.

Yes, I found that code. I’m trying to find what method/methods get called to start the process.

As I stated… this is code ripped from an existing application.

But basically it calls the EXIF utility with SHELL and returns all the data… that then needs to be parsed depending on your requirements

Okay. I’ll look at it some more…

You might have a look here: Kanzu Software. David Lloyd offered a number of REALBasic classes, including one called Image Info.

He no longer supports them, having apparently moved on to doing photography full time. You can still download them, though, and it appears that he may be willing to share and/or sell the source code. The last time I used them was several years ago, so I don’t know if they are compatible with Xojo, and if so, for how long that might continue to be the case. Very easy to use, though…

Thank you Peter.

I’m getting a “EXIFTool is not recognized as an internal or external” message with the following code:

cmd="EXIFtool -s -n "+path
sh.execute cmd

EXIFTool.exe is in the folder where I’m executing the code.

This is Windows 8