read focus distance with ImageMagick

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
Ringostarr

read focus distance with ImageMagick

Post 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.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: read focus distance with ImageMagick

Post 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
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Ringostarr

Re: read focus distance with ImageMagick

Post 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?
el_supremo
Posts: 1015
Joined: 2005-03-21T21:16:57-07:00

Re: read focus distance with ImageMagick

Post 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
Sorry, my ISP shutdown all personal webspace so my MagickWand Examples in C is offline.
See my message in this topic for a link to a zip of all the files.
Ringostarr

Re: read focus distance with ImageMagick

Post 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!?
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: read focus distance with ImageMagick

Post 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 ?
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: read focus distance with ImageMagick

Post 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
el_supremo
Posts: 1015
Joined: 2005-03-21T21:16:57-07:00

Re: read focus distance with ImageMagick

Post by el_supremo »

There's an EXIF tag called Subject Distance but I can't find anything about Focus Distance in exiftool.

Pete
Sorry, my ISP shutdown all personal webspace so my MagickWand Examples in C is offline.
See my message in this topic for a link to a zip of all the files.
Ringostarr

Re: read focus distance with ImageMagick

Post 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
Post Reply