Saving jpeg images with metadata intact

Please use this forum to post bug reports, feature requests, tips, etc. for beta versions of Picture Window Pro 8

Moderator: jsachs

jsachs
Posts: 4203
Joined: January 22nd, 2009, 11:03 pm

Re: Saving jpeg images with metadata intact

Post by jsachs »

I am investigating IPTC and XMP metadata. After doing some research I think the most robust approach is to use WIC just for reading and writing images and to handle metadata using a separate library, Exiv2. This probably involves writing image files twice, once to output the image data and once to rewrite them with metadata added so there may be a performance hit, but it provides a lot more control and should allow, for example, embedding scripts in JPEG files again.

Let me know if there is a useful subset of IPTC and XMP metadata that it is worth adding the ability to edit from within the Image Info dialog box. Clearly it's a huge job to edit all of it, but if there are a few fields that get used all the time I may be able to add them. At a minimum I should be able to preserve EXIF, IPTC and XMP metadata when saving TIFFs and JPEGs.
Jonathan Sachs
Digital Light & Color
Winfried
Posts: 239
Joined: June 18th, 2010, 4:27 pm
What is the make/model of your primary camera?: Pentax K1

Re: Saving jpeg images with metadata intact

Post by Winfried »

To my opinion there is no need to make PWP a metadata editor. I do all my metadata editing in a separate product, .i.e. a DAM. (i.e. Imatch).
Winfried
-----
migrated to Windows 10 in Nov. 2019
PWP Pro 64
CUDA not available
den
Posts: 856
Joined: April 25th, 2009, 6:33 pm
What is the make/model of your primary camera?: Canon EOS-350D/Fuji X100T
Location: Birch Bay near Blaine, WA USA

Re: Saving jpeg images with metadata intact

Post by den »

...
Ref: PWP8.0.exe 10.5 Feb 2019

1) I agree with Winfried... ...do not try to became a major meta data editor...

2) FYI current "Image Info" data for a Fujifilm X100T camera:
PWP8 Image Info-Lens-Notes and ExifTool.exe Options-1-1.jpg
PWP8 Image Info-Lens-Notes and ExifTool.exe Options-1-1.jpg (82.1 KiB) Viewed 3068 times
a) Subject Distance should be "Unknown" if the tag SubjectDistanceRange is used by PWP8.
b) Lens Info, Make, and Model are not past on to the tiff conversion file by Fuji's Raw File Converter Ex 2 program so they must be manually added.
c) Description, Author, and Copyright must be manually added.
d) I do not utilize GPS coordinates.

I will use ExifToolGUI v5.16 with ExifTool v11.2.6.0 to batch process jpegs, tiffs, and RAF, CR2 files with the desired meta data changes. While ExifToolGUI is not maintained, it still will work with the latest ExifTool.exe version for the minimal preference changes.

...den...
jsachs
Posts: 4203
Joined: January 22nd, 2009, 11:03 pm

Re: Saving jpeg images with metadata intact

Post by jsachs »

You are confusing Subject Distance with Subject Distance Range which is a different Exif tag. Subject Distance is in meters, although 0 is supposed to indicate unknown and not 0 meters.

Each camera supports its own collection of tags. The missing ones will show up blank.
Jonathan Sachs
Digital Light & Color
jsachs
Posts: 4203
Joined: January 22nd, 2009, 11:03 pm

Re: Saving jpeg images with metadata intact

Post by jsachs »

Here are the options I have discovered so far that would solve the lost metadata problem in the current PWP 8. None of them are ideal. Let me know what you think.

1) Use ExifTool

In this option, a copy of ExifTool is installed alongside PWP. I could then call ExifTool to copy metadata from the input file, if any, to the output file on File Save. This would not work for the embedded script private tag in TIFF files, so scripts would have to be written as a separate side-car file, which has certain other advantages and disadvantages. This option would do a very good job of retaining all metadata. I would probably have to remove the ability to edit any of the metadata from PWP. On the downside, ExifTool is written in Perl, so loading it and running it on every File Save might slow things down a little, even for small files. Copying all metadata could be an option as some users may not need it and may not want the overhead.

2) Use Exiv2

Exiv2 is a library that can be integrated with PWP so it should be a lot faster than ExifTool. Currently it does not support private EXIF tags or EXIF tags larger than 64Kb, so there go embedded scripts again. They may be adding these features later this year - I need to check back with them in April. This problem could be avoided again by making scripts side-car files. If they add the features, I should be able to save embedded scripts in both JPEG and TIFF files.

Licensing

ExifTool can be licensed and redistributed for free as long as certain copyright notices are reproduced.

Exiv2 is under the GPLv2 license so I would have to make PWP8 free and make its source code freely available as long as I include it. While I was planning to make PWP8 free, at least initially, I was not necessarily planning to make the source code public.

Side-car Script files

Making side-car script files would mean they could be saved along with any file type (e.g. as a .script file with the same filename as the image file), not just TIFF. It would also eliminate the use of a private tag which, more likely than not, would get stripped out if you edited the image in some other program. It would also give you the option of distributing the image without the script but still having it yourself, or to delete the image file but keep the script.

The problem with side-car files is that they can easily get out of sync with or separated from the image file they go with, so there is more of a burden on the user to keep the files together.
Jonathan Sachs
Digital Light & Color
Winfried
Posts: 239
Joined: June 18th, 2010, 4:27 pm
What is the make/model of your primary camera?: Pentax K1

Re: Saving jpeg images with metadata intact

Post by Winfried »

I vote for the Exiftool way. Exiftool is something like a standard for metadata handling and quite robust. The metadata reading and writing in Imatch is done by Exiftool. I cannot remember of any problems. Performance should not be an issue since normally we are handling one file after the other and copying/writing the metadata takes place normally in the last step of a transaction-flow.

I can live with sidecar files since my DAM (Imatch) can handle these. I just have to define these scripts-files as "buddy-files" and Imatch takes care of them (for instance: if I copy a file to another directory the buddies are also copied, if I rename a file the buddies are renamed too. This work even with the stupid buddy file structure that is created by capture one. Of cause all these operations have to be done under the control of Imatch). I rate buddy-files as least as robust as internal data since not all programms honor all kind of metadata. That is a problem with the private Exif tag. Maybe it is worth to think about a private xmp name space and write the script data into this structure. Maybe it is sufficient to use the xmp mechanism just as an envelope for the script data.

Short: Yes go the Exiftool way and I can live with sidecar files.
Winfried
-----
migrated to Windows 10 in Nov. 2019
PWP Pro 64
CUDA not available
MarkT
Posts: 366
Joined: April 24th, 2009, 2:07 pm

Re: Saving jpeg images with metadata intact

Post by MarkT »

Not sure I understand the need to complicate PWP8... I have the original image files, with all of the original EXIF information, which I can access at anytime (usually with ExifTool). After I edit files, if I'm posting them online I remove all EXIF data (via FastStone "Remove JPEG Metadata" tool). If I'm interested in keeping the PWP8 script data I save as TIFF. I used to use IMatch, which keeps track of all of its keywords and tags, but since I've retired I only use a personalized folder structure to organize images (much, much simpler...).

For my $0.02, I'd rather see PWP8 kept simple, efficient and safely under Jonathan's control (in terms of source code...). But then, I defer to those of you who are more technically adept to sort these things out.
jsachs
Posts: 4203
Joined: January 22nd, 2009, 11:03 pm

Re: Saving jpeg images with metadata intact

Post by jsachs »

Thanks for your feedback,

This would not complicate things for the user, just prevent a round trip through PWP8 from removing metadata that, to some users, is important. All the complication is under the hood, and frankly it doesn't look that difficult to call ExifTool from within PWP.

I am currently leaning toward using ExifTool to copy metadata from the input file when saving and storing the script as a separate file. I should have something working soon, and then if it doesn't work out I can put it all back the way it was.

If you are saving without any metadata or profile, then ExifTool will never get called.
Jonathan Sachs
Digital Light & Color
Bob Walker
Posts: 78
Joined: April 25th, 2009, 9:08 am
What is the make/model of your primary camera?: Canon R5
Location: Los Alamos, New Mexico
Contact:

Re: Saving jpeg images with metadata intact

Post by Bob Walker »

Jonathan,

Sorry, I disappeared while on vacation. My vote would be to use ExifTool.

Thanks,
Bob W
Locked