Page 1 of 1

read focus distance with ImageMagick

Posted: 2009-01-21T03:51:19-07:00
by Ringostarr
hi,

can anyone tell me, if it is possible to read the focus distance with ImageMagick.
I tried it with

Code: Select all

identify -format %[exif:*] filename.jpg
other Applications like exiftool oder PhotoMe can read this Information.

I have the Version 6.4.5 of ImageMagick installed.

Re: read focus distance with ImageMagick

Posted: 2009-01-21T17:57:09-07:00
by anthony
That should work though you may need quotes arounf the format argument to stop Shell and DOS interpreting the special characters.

See IM Examples, Photo Handling, EXIF data, for one example
http://www.imagemagick.org/Usage/photos/#exif

Re: read focus distance with ImageMagick

Posted: 2009-01-22T07:47:04-07:00
by Ringostarr
it changes nothing with quotes. I'm getting the same result without focus distance.
Any other ideas? Can ImageMagick generally read this Tag?

Re: read focus distance with ImageMagick

Posted: 2009-01-22T08:43:34-07:00
by el_supremo
Not all cameras record the focus distance and, of those that do, some record it in the proprietary makernote EXIF field.
Are you sure that the focus distance is there in the first place?

Pete

Re: read focus distance with ImageMagick

Posted: 2009-01-22T09:16:27-07:00
by Ringostarr
I don't know, if the focus distance is recorded in the proprietary makernote EXIF field.
I only know, that it is recorded, because the Applications "PhotoMe" and "exiftool" can show this Tag.
The exiftool shows, that the "tag ID number" for FocusDistance is 0x0009, it seems to be an Offset!?

Re: read focus distance with ImageMagick

Posted: 2009-01-22T11:07:07-07:00
by Bonzo
My new Canon does not generate a focus distance and on a test image I get 47 results for a jpg image.
According to http://www.exif.org/Exif2-2.PDF there can be 57 different "official" results for an image? + GPS 31 results and numerous others.

Either ImageMagick is not picking up all the latest tags or if the tag is empty it is not displayed ?

I added some GPS data to an image and when the data was displayed again I had 2 extra tags:
1/ A GPS Info number
2/ EXIF data modified by setting.
So I assume empty EXIF tags are not displayed ?

Re: read focus distance with ImageMagick

Posted: 2009-01-22T11:23:13-07:00
by Bonzo
Running the same image through the php EXIF function I get 104 results. Still no focal distance but there are values similar to 0x0009 in the "MAKERNOTE." section.

Thinking about this - FocusDistance is 0x0009 - the 0x0009 is a hex number or a position within the file ? A "segment marker" or "Private Tag"

Using "Kuso Exif viewer" I get 172 results, are some of these results not EXIF data but other types of metadata e.g. IPTC?

The only results to do with focus are:
FocusDistanceLower: 0
FocusDistanceUpper: 5.84
FocusMode: Single
FocusRange: Auto

Re: read focus distance with ImageMagick

Posted: 2009-01-22T15:12:05-07:00
by el_supremo
There's an EXIF tag called Subject Distance but I can't find anything about Focus Distance in exiftool.

Pete

Re: read focus distance with ImageMagick

Posted: 2009-01-23T08:06:08-07:00
by Ringostarr
right el_supremo, there is a tag called Subject Distance in the EXIF specifications, but exiftool can also find Focus Distance. If you type

Code: Select all

exiftool -list
there is also FocusDistance in the very long list.

So, it seems that ImageMagick can't read this tag. :(

@Bonzo
if I print out the MakerNote Section with php-function exif_read_data() it outputs something that I can't read. It seems to be binary data