ExifTool Forum

ExifTool => Newbies => Topic started by: Idiotfool on November 08, 2017, 08:20:30 PM

Title: Max Aperture writing in oddly
Post by: Idiotfool on November 08, 2017, 08:20:30 PM
Greetings, all.

I run a batch process in Photoshop to edit a gamut of photos as data sets, but the meta data is lost in this process. I use exiftool to extract from the untouched photos and import it into the edited photos. The gist of how I'm doing this can be seen in thos old thread: https://exiftool.org/forum/index.php?topic=8312.0

Quick summary is that I extract everything from a folder and write to a .csv.


I then manipulate and import that .csv with exiftool and load the meta data into the files of interest.


The problem is that the Max Aperture is giving me a ridiculous number. If the initial photo had an aperture of 4.3, the edited file shows 4.2738394498404. While this rounds to 4.3, it certainly looks odd.

Everything else imports fine. I've also renamed the out.csv file to in.csv and when I run the above with the original files I just extracted the meta data from, I see the same problem. The values that are being written are nowhere to be seen in the .csv file, either, making this even more puzzling.

Has anyone else seen this problem previously? Have you resolved it? Is this a bug or is it something I'm doing?

Thanks!
Title: Re: Max Aperture writing in oddly
Post by: Phil Harvey on November 08, 2017, 08:56:06 PM
I assume you are talking about MaxApertureValue.  I get this:

> ./exiftool a.jpg -maxaperturevalue=4.3
    1 image files updated
> ./exiftool a.jpg -maxaperturevalue -n
Max Aperture Value              : 4.30000004526018
> ./exiftool a.jpg -maxaperturevalue -csv > out.csv
> cat out.csv
SourceFile,MaxApertureValue
a.jpg,4.3
> ./exiftool a.jpg -all=
    1 image files updated
> ./exiftool a.jpg -csv=out.csv
    1 image files updated
> ./exiftool a.jpg -maxaperturevalue -n
Max Aperture Value              : 4.30000004526018


I think there must be something else going on here with the file you are using.  Can you provide an example that I can reproduce?  (I'm on Mac so I used the "cat" command to see the csv file.  If you're on Windows, use "type" instead.)

- Phil
Title: Re: Max Aperture writing in oddly
Post by: Idiotfool on November 13, 2017, 10:15:08 AM
See the attached.

I extracted the meta data into out.csv, renamed the .csv to in.csv, then imported and overwrote the meta data onto the same file. I renamed that to "edited" and placed another copy of the original file into the folder.

The .zip file has the photos and the in.csv file.

Let me know if you need anything else. Thanks!

Edit: I can't seem to upload. It's a 7.9 MB zip file, so I'm not sure what the problem is. See this file: Issues.zip (https://nofile.io/f/JojX7hGpb6r/Issues.zip)
Title: Re: Max Aperture writing in oddly
Post by: Phil Harvey on November 13, 2017, 10:30:25 AM
I think the problem is that you are confused because Exiftool displays MaxApertureValue as an equivalent f-number while it is stored as an APEX value.  You must be looking at the values with some other software.

For example, a max aperture of f/3.5 is stored as 3.614709852, but extracted by ExifTool as 3.50000000956431 (with rounding errors on my system).  You can see the APEX values in ExifTool only with the -v option.

- Phil
Title: Re: Max Aperture writing in oddly
Post by: Idiotfool on November 13, 2017, 10:59:41 AM
Phil, it seems I renamed them incorrectly. Original has the overwrite while Edited was the actual original.

In using PC, when I look at Properties>Details of the file, I see the attached.

When I open the .csv in excel, I see nothing indicating the displayed 3.164708... number.
Title: Re: Max Aperture writing in oddly
Post by: Phil Harvey on November 13, 2017, 11:03:20 AM
As I said, ExifTool displays this as an equivalent f-number.  Other software probably displays the APEX value.

- Phil
Title: Re: Max Aperture writing in oddly
Post by: Idiotfool on November 13, 2017, 11:38:34 AM
Interesting. If I repeat the extraction and importation with a fresh "original" file...

>exiftool original.jpg -maxaperturevalue -n
Max Aperture Value              : 3.4822022531845

>exiftool -csv . -all:all > out.csv
    1 directories scanned
    1 image files read

>exiftool -csv=out.csv . -overwrite_original
    1 directories scanned
    1 image files updated

>exiftool original.jpg -maxaperturevalue -n
Max Aperture Value              : 3.50000000956431


Using your code to limit the export to just the maxaperturevalue...

>exiftool original.jpg -maxaperturevalue -n
Max Aperture Value              : 3.4822022531845

>exiftool original.jpg -maxaperturevalue -csv > out.csv

>exiftool original.jpg -csv=out.csv
    1 image files updated

>exiftool original.jpg -maxaperturevalue -n
Max Aperture Value              : 3.50000000956431


Help?
Title: Re: Max Aperture writing in oddly
Post by: Phil Harvey on November 13, 2017, 11:44:00 AM
Here you have exported to CSV without the -n option, so it is rounded to 3.5.

There are 3 possible values:

> exiftool original.jpg -maxaperturevalue
Max Aperture Value              : 3.5
> exiftool original.jpg -maxaperturevalue -n
Max Aperture Value              : 3.4822022531845
> exiftool original.jpg -v | grep MaxApertureValue
  | | 11) MaxApertureValue = 3.6 (18/5)


See here (https://exiftool.org/under.html#conversions) for an explanation of the different values.

- Phil
Title: Re: Max Aperture writing in oddly
Post by: Idiotfool on November 13, 2017, 11:57:19 AM
That did it! I needed to include the -n into the export:

exiftool –csv . –all:all -n > out.csv

Thanks!
Title: Re: Max Aperture writing in oddly
Post by: Idiotfool on November 13, 2017, 03:33:10 PM
Well, inclusion of -n has opened up another issue. Periodically, the images are being rotated through Exiftool. Any suggestions on which parameter might be controlling orientation so that I can overcome this?

Thanks!
Title: Re: Max Aperture writing in oddly
Post by: Phil Harvey on November 13, 2017, 03:43:42 PM
This is likely because you are writing the EXIF Orientation tag.

- Phil
Title: Re: Max Aperture writing in oddly
Post by: Idiotfool on November 13, 2017, 03:52:35 PM
Hah. Sorry - it must be really annoying to have written such a great utility application and to be pestered by idiots like myself.

In my .csv file (generated with -all:all -n), the orientation is shown as 1. When Exiftool writes this into the jpeg file, exiftool shows the orientation, now, as "rotate 180°". If I look it up with -n, it gives me the numeric of 3.

Any suggestions with either the export or import commands that can overcome this issue?

Thanks!
Title: Re: Max Aperture writing in oddly
Post by: Phil Harvey on November 13, 2017, 03:59:55 PM
When exporting, I would add --Orientation to exclude the Orientation tag.  Plus any other tags you don't need.

- Phil
Title: Re: Max Aperture writing in oddly
Post by: Idiotfool on November 13, 2017, 04:04:01 PM
That works. Thanks, again! Sorry for the stupid questions, but really appreciate the help!