Manually-added picture metadata not being retained

Doing some experimentation with image metadata via DOpus (v12.8; I just now see that v12.9 is out) and ExifTool (v10.99). I created a dummy PNG (just a white square) and attempted to add metadata to every available field via DOpus’ Set Metadata dialog. (it is acknowledged that most of the Picture Properties fields would not typically be added manually to an image.) It appeared to accept everything I input, and made no complaints when I closed it using the OK button, but when I re-opened the same file in Set Metadata, seven of the Picture Properties fields were empty, all of which are governed by drop-down choices:

Contrast
Exposure Program
Metering Mode
Saturation
Scene Capture Type
Sharpness
White Balance

I also tried setting each of these by typing single-line commands such as “>SetAttr META whitebalance:manual”, using a variety of keywords and number values for the fields, but the fields remained empty in Set Metadata following all attempts.

I then used ExifTool to extract all metadata to a JSON file. The resulting file indicates that the following metadata groups/names/values do in fact exist in my dummy PNG:

"XMP:Contrast": "Low"
"XMP:ExposureProgram": "Aperture-priority AE"
"XMP:MeteringMode": "Center-weighted average"
"XMP:Saturation": "Normal"
"XMP:SceneCaptureType": "Standard"
"XMP:Sharpness": "Hard"
"XMP:WhiteBalance": "Auto"

But none of these are reflected in Set Metadata. The documentation for ExifTool tells me there are corresponding EXIF tags for all of these, but they evidently aren’t set by Set Metadata. Bug or not-yet-completed (but documented as such) feature?

I will retry all of this with v12.9, but the change log doesn’t seem to indicate any relevant changes.

I did a quick test setting the Contrast field on a PNG (with no other metadata initially) and it was still there afterwards.

Does what you're seeing only happen for PNGs created in some ways and not others, or only with certain combinations of new or existing tags?

I’ve uploaded a 7-zip with five copies of the same PNG (created with Corel PaintShop Pro v20), with four of them having undergone various stages of tests, as described below:

“Test-white-1000x1000x24-PNG.7z” (3,019)

Contents:

  1. “Test-white-1000x1000x24-0_NOtags.png” (5,322)

No tags added.

  1. “Test-white-1000x1000x24-1_ALL+,7MIA.png” (9,533)

All tags added, but the 7 problem tags are MIA afterwards.

  1. “Test-white-1000x1000x24-2_7+.png” (5,456)

The 7 problem tags added, one at a time; no apparent issues.

  1. “Test-white-1000x1000x24-3_ALLpicture+.png” (5,755)

All other Picture Properties tags added to a copy of test 4 result; no apparent issues

  1. “Test-white-1000x1000x24-4_ALL+.png” (9,010)

All remaining tags (Document and Extended Properties) added; no apparent issues

I haven’t tried creating any PNGs with other software for these tests, but since we already have inconsistent results, I don’t believe I need to. Let me know if you determine otherwise.

Test-white-1000x1000x24-PNG.7z (2.9 KB)

So… were you unable to reproduce the problem with my uploaded PNGs?

I can reproduce that one of the images in the archive doesn't let some tags be added.

We haven't investigated in further detail yet but have it in our queue. Will update the thread when we have something more.

Ok, thanks.

Another round of experimentation with DOpus and ExifTool. Ideally, I would like to be able to use ExifTool to write/copy/modify tags, but still be able to display (most of) them via DOpus’ Metadata Panel, or the Set Metadata dialog. However, this new round of experiments seems to indicate that many tags added by ExifTool are not displayed by DOpus, even if they are tags that DOpus ordinarily displays. I used ExifTool to extract all tags from a PNG in which I had successfully added every displayable tag via DOpus’ Set Metadata dialog, to a JSON file. I then made a copy of that JSON file, and edited the copy to make it suitable for import (I changed the name of SOURCEFILE to the file I would be importing into). I then used ExifTool to import tags from the edited JSON into an empty (no displayable tags in DOpus) PNG. When I opened the resulting PNG in the Set Metadata dialog, however, only the following tags had any values displayed:

Instructions
Title
Comment
Tags

I used ExifTool again, this time to read all tags from the PNG I had just imported to. It looks like all the necessary tags are there, but DOpus isn’t displaying them.

7-zip attached: “DOpus+ExifTool Export&Import JSON Test.7z” (4,028)

Contents:

“DOpus+ExifTool Export&Import JSON Test\”

“0_NO-tags.png” (5,322)

PNG with no tags that are displayable in DOpus

“0_NO-tags.json” (969)

All tags extracted from “0_NO-tags.png”

“1_ALL-DOpus-tags.png” (9,010)

PNG with ALL tags that are displayable in DOpus

“1_ALL-DOpus-tags.json” (3,436)

All tags extracted from “1_ALL-DOpus-tags.png”

“2a_Tags-for-Import.json” (3,452)

Copy of “1_ALL-DOpus-tags.json”, edited for SOURCEFILE and FILENAME entries to better facilitate importing via ExifTool

“2b_Tags-Imported-from-2a.png” (7,710)

Copy of “0_NO-tags.png” with tags imported from “2a_Tags-for-Import.json”

“2c_Tags-Exported-from-2b.json” (3,732)

All tags extracted from “2b_Tags_Imported-from-2a.png”

DOpus ExifTool Export&Import JSON Test.7z (3.9 KB)

How are you adding the tags (e.g. command line used)? Are they definitely EXIF tags? (ExifTool can create several tag types, if I remember correctly.)

Command line for extraction from “1_ALL-DOpus-tags.png”:

exiftool -json -struct -G ".\1_ALL-DOpus-tags.png"

“-G” causes ExifTool to print group names (File, EXIF, XMP, IPTC, PNG, Composite, etc.) before each tag name.

Command line for import to “2b_Tags-Imported-from-2a.png”:

exiftool "-json=.\2a_Tags-for-Import.json" -m -a ".\2b_Tags-Imported-from-2a.png"

“-m” is short for “-ignoreMinorErrors”

“-a” allows duplicate tags (tags with the same name but in different groups) to be extracted (or apparently imported).

If you examine the contents of “1_ALL-DOpus-tags.json”, you’d see that there are several sets of corresponding tags with the same name and/or function, in different-named groups. For example, I found the following pairs of tags to store the same string per pair, as set using DOpus’ Set Metadata dialog:

EXIF:XPComment
XMP:UserComment

IPTC:ObjectName
XMP:Title

IPTC:SpecialInstructions
XMP:Instructions

IPTC:ObjectName
XMP:Title

IPTC:Keywords
XMP:Subject

ExifTool recognizes about 125 different types (groups) of tags, of which EXIF is one. Not all of the tags written by DOpus to image files are EXIF tags, as evidenced above.

My goal in exporting and importing tags is to recreate ALL existing safe, writeable tags to the same groups in the target file. My comparison of the JSON files “2a_Tags-for-Import.json” and “2c_Tags-Exported-from-2b.json” tells me that all writeable tags from the former also exist in the latter (though they are not all listed in the same order in both JSONs), which should mean that the PNG the latter JSON was extracted from contains all those tags.

FYI, I also posted this information about my tests with DOpus and ExifTool to the latter’s forum, and got some interesting feedback from the author and one of his moderators, which you can find here if it’s useful.

1 Like

I spent over 20 years working for a large news gathering operation. During that time I worked on most every aspect of electronic imaging from the early Hasselblad picture desks to the later multi-million image picture storage and retrieval systems.

Our business depended absolutely on being able to pass images and their metadata around the world in the sure and certain knowledge that the recipient would be able to read both the image and its metadata.

In the whole of my experience, I never came across a single organisation that stored its images as PNG files. Of course, in isolation, you can keep your images in any format you like, but if you want to spread your pictures, you will soon hit trouble.

If you do not like the idea of compressing your files, my advice would be to look at the TIFF format with LZW compression. The compression is completely lossless, and though it will never match the compression of JPEG it does make a considerable difference to the size of the files. It also has the advantage of supporting layers and transparency.

In my experience the only real problem with JPEG at a reasonable compression (8 or 9) comes if you are in the habit of continually and repeatedly cropping the images and re-compressing them.

The absolute key to electronic imaging is to make sure your image has enough pixelar information for the task in hand. Everything after that is mere detail. For that reason it is vital that you treat your digital negatives with the same respect as you treated their celluloid forbears.

In case it is of any help, I employ the following image storage schema:

Images for domestic or newspaper use are kept as JPEG at 90 percent compression at 240 res.

Images for magazines are kept as LZW compressed TIFF files at 600 res

Multi layered files (generally above 15 layers) are kept as PSD files.

All my digital camera raw files are kept in Adobe's DNG (digital negative format).

All - with the exception of the DNG files- have their metadata added via DOpus.

auden — Thank you for your suggestions. I chose to use PNG because it is losslessly compressed, widely supported, and I can convert to it using DOpus. Clearly, it does have some disadvantages in the metadata support department, and I’m not going to rule out going to some other lossless format at some point. My experience with TIFF is limited, but I know I had some reasons for deciding against it, even if I can’t remember what all of them were at this point. Layers and transparency are features I often use in the midst of editing, but I currently have no need to save images with them.

I’m mainly dealing with photographs that are largely shared with family members, and scans of various old publications shared with a small circle of enthusiasts for a certain author who is published within. All of the scans are heavily touched up by me, and quite a few of the photos are either touched up or cropped prior to sharing.

My main problem is that my image editors (mostly PaintShop Pro and GIMP) discard all metadata when I save after editing, so I need something like ExifTool to export the metadata to a separate file that I can then import from after editing. DOpus is certainly good for adding and editing metadata, but it stops a bit short of my needs. ExifTool, in addition to importing and exporting metadata, allows me to add custom tags, which I definitely intend to start doing with the publication scans.

I don’t know how Photoshop handles existing metadata when editing and re-saving, but I’m not prepared to shell out for a subscription to it, and even when it was non-subscription software it was out of my price range. I’m not in the business of selling any of the images I work on.

Cloud storage is another factor for me. I use a free Google Account, which limits me to 15 GB for email, docs, drive, and photos, but if I have my Google Photos set to high quality rather than original quality, the photos don’t count against my storage limit. I’ve found that Google Photos doesn’t reduce the resolution or quality of PNG images, as long as they are 16 megapixels or less. JPEGs and videos are reduced, and RAW files are converted to JPEG. Not sure about other formats.

Thanks again. Any other suggestions, I’m open.

If PNG fulfills all your needs aside from the metadata, that is great and a perfectly good solution for you. Of course, I was outlining a professional workflow in a very large organisation.

What you perhaps could experiment with is keeping a copy of the PNG with the original metadata and making your edits on another copy. Then I assume (although I know nothing of the PNG format) that you could use the standard Opus metadata tools to copy the metadata back to the edited file from the copy.

That method works a treat with TIFFS and JPEGs.

auden — May, I ask, how exactly do you accomplish copying metadata between files using DOpus? I have tried to do that without success. I was given to understand that, with the Set Metadata dialog open with “Image2.png”, for example, I’m supposed to be able to drag and drop “Image1.png” onto the dialog to copy the metadata (and indeed, when I drag it over the dialog, a “+ Copy Metadata” tooltip appears), but only Authors, Copyright and Instructions are copied for me.

This is what I see when I do as you suggest with a jpg file. I am right mouse-clicking , by the way Left mouse clicking gives a different result:

I always select the last option:

Copy all picture fields.

Could you be choosing the first option?

A quick test with a PNG file here shows it works with that format, too.

Well, shoot. Somehow I completely missed that right-clicking/dragging was an option. Thanks much auden, that makes a huge difference. I notice, though, that it still doesn’t copy the Extended Properties (Comment, Rating, Tags), of which I do regularly use Comment and Tags. What are the chances of getting an option for those added, Leo and/or Jon?

@mazeckenrode

Comment and tags copying to a PNG file works fine, here - though I have to admit I have only tried it a couple of times. Copied tags picked up fine by Photoshop, which is always a good sign.

I’ve tried using your method to copy Comment, Rating and Tags between two PNGs, two JPEGs, from JPEG to PNG, and from PNG to JPEG. None were successful. All files used are stored on an NTFS partition, in case that is necessary, though I’m sure it isn’t for the JPEGs, and I don’t think it would be for PNGs either, considering that ExifTool is able to extract EXIF/IPTC/XMP tags that appear to correlate to those three fields.

So I guess now, the question is why doesn’t this work for me when it works for others? Am I missing something?

@auden, if you don’t mind, could you please download and extract the 7-zip I attached to message #8 in this thread. Please try copying all metadata from “1_ALL-DOpus-tags.png” to “0_NO-tags.png” on your system, and tell me if it failed to copy anything.

@mazeckenrode

It probably is not what you want to hear, but it works perfectly here. Might I suggest that you try to take EXIFTool out of the equation and use the Opus metadata pane. Does that pick up all the camera info you require from digital cameras? I have never done much work with the more esoteric camera fields, so I am not the right person to ask about this aspect of your problem, but I can absolutely confirm that Opus handles things like Flash, Camera Make, Focal length; Lens Type with aplomb.

As you seem to working with many old images taken with film cameras, there will not be any camera info anyway.

The observation I would make about Opus and metadata is that over the last couple of years the developers have done some stirling work to ensure that the metadata schema for Opus matches the metadata schemas of other mainstream imaging programs like Photoshop and Lightroom.

Perhaps it would make sense to investigate other image editing programs in the affordable range that might not ditch the metadata after editing. I cannot conceive in my wildest dreams why an imaging editing program would ever do that. It's just plain crazy.

@auden

It is actually what I figured I'd hear. There seems to be some sort of technological curse on me going back at least 25 years. There have been numerous things, with various computers and other pieces of technology I’ve owned, that work for other people with identical equipment, but not for me.

My most recent experiments with copying metadata from another image file have been performed using DOpus, not ExifTool. Still, the Comment and Tags fields are not copied for me.

Thanks for indulging my questions and requests, and for your suggestions. I’ll keep it in mind to look at other image editors, but since I can’t count on things working for me the way they’re supposed to work, I can’t help being cynical about it.

I’m also hoping that @Leo or @Jon might have something to say about the lack of ability to copy Comment and Tags on my end, even though it works for others.