Manually-added picture metadata not being retained

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.

Hello,

Are you doing this inside a compression? have you extract the content of archive out to the folder? then only you make changes to Picture's Metadata and check if the metadata changes stays.

Afaik, archived file being open is always stored in a temp folder, any changes you make to them will not be save in archive, as when you open them again, they will just extract from archive again and to another temp folder. Or some archive does not allow editing.

@mazeckenrode

After reading your comments again, I began to get a tad concerned that I had somehow got my hands crossed when I tried the experiment you wanted me too. I decided now I had more time to do the tests again in a more controlled way.

You will be pleased to know that I have managed to reproduce the the problem you are having. I tried to use Opus to copy the metadata from a PNG file I created and filled with metadata. I created some tags in the file and copied the Description field to the Comment field.

I then checked the PNG in Opus and Photoshop. The tags were all present and correct.

I then opened the 0-tags file and used the standard method of copying metadata from my PNG to yours - i.e. copy all picture metadata fields. The tags and the comment field were not copied. Worse still, the tags and comment on my file disappeared.

Several more experiments with files I created and PNG files yielded the same results.

No, you are not losing your marbles, my friend, there appears to be some kind of a problem here.

@Cyclonechuah

If you’re referring to the 7-zip I uploaded, no, I am not operating on the files inside of it.

@auden

How did you do that? Manually (click in Description & copy, click in Comment & paste) or custom DOpus command or script? Just curious.

I haven’t had any already-existing metadata in a file disappear, so far.

Well, I’m sort of glad to hear I’m not the only one who has problems copying metadata, anyway. Thanks.

@mazeckenrode

I normal add my metadata to pictures using a VB macro I have written. As I did not wish to add an extra variable to this already spiky equation, I used the Opus metadata panel to add the comment field.

A word about the comment field: This field is NOT the same field as the IPTC Description field (aka caption). Because I use the Windows Indexing system to find my files quickly, I have found in necessary to copy the the Description field into the Comment field via my macro, as Windows Search will not search on the Description field but will on the Comment.

Ah, the wonders of metadata!

@auden

One of my goals in adding all available metadata to “1_ALL-DOpus-tags.png” was to extract using ExifTool and see where all that metadata actually goes (for PNG files, anyway), which is why I set field values to field names where possible. For example:

DOpus Comment = EXIF:XPComment, XMP:UserComment

DOpus Title = IPTC:ObjectName, XMP:Title

DOpus Tags = IPTC:Keywords, XMP:Subject

DOpus Instructions: IPTC:SpecialInstructions, XMP:Instructions

I don’t suppose you’d mind sharing any of your VB code for dealing with metadata? I’m interested in getting my hands dirty, at least a little bit, but the only scripting I’ve done in Windows is AutoHotkey and some very minor JavaScript (for HTML), and I have no idea where to begin with VB.

Moving to private messages might make sense if you want to discuss code and experimenting on things.

This thread is quite hard to keep track of now, in terms of being about any particular issue. (This often seems to happen with metadata threads. As a general request, can we please try to keep them to a single issue, and resist diverting every metadata thread into a general philosophy of image metadata in future.)

Got it. Sorry.

I think we've finally got to the bottom of this and hopefully will have a fix for it in the next update.

1 Like