Metadata in WebP (and PNG, would be nice)

When I export to Lossy WebP, I get absolutely no metadata. I know that the standard allows for metadata, (unlike PNG, which has a workaraound for metadata), and expect to have it all, just like my JPEGs do.

Am I missing something?

OS: Ubuntu 18.04.4 (for now. Expect a change in April 2020)
App: Darktable 3.0.0-1.1 (download.opensuse.org)

Thanks.

FYI, the PNG spec now has an eXIf chunk:

http://ftp-osl.osuosl.org/pub/libpng/documents/pngext-1.5.0.html#C.eXIf

1 Like

PNG is not a file format for photographs. It’s intended for graphics (logos, graphs, icons). I don’t know what you’all have with this habit of saving photographs as PNG, but it’s bloody heavy for no benefit.

So I wonder what the use case for metadata in PNG is. Put the graphic designer in the credits of the icon where nobody will open it ?

It accommodates 16-bit RGB data and lossless compression.

It’s hard sometimes to find a least-common-denominator format moving from software to software with an image, so I think it’s good to have options…

3 Likes

@TopRockPhoto, I apologize, we aren’t helping you here. I looked at the darktable docs, I think there’s something in Export that allows one to filter which tags go to the output image. dt uses the exiv2 metadata library, which handles PNG metadata. I’m not a dt user, will need a regular user to comment. I have 3.0.0 installed on another machine; if I can get to it this evening I’ll try a PNG export…

Edit: Oh geesh, you’re interested in WebP; exiv2 reads and writes everything but IPTC to WebP. I’ll also try one of those tonight.

2 Likes

I for one know it’s a bad format for photos but we do have shitty use-case: a closed source “popular platform” manages to mangle JPEGs and make good ones look horrible when uploaded from PC. However if you upload a full-size PNG it compresses it down to good looking JPEG. This limitation is present in another way in "smart"phone - due to budget constraints the one we have at hand cannot handle some forms of JPEGs while reading others, however it has no problems with PNGs :confused:

Yeah - I know, “ditch popular platform”. I wish :pray: however with current limitations we do have usecase for PNGs.

Fun fact tho - we actually don’t have usecase for metadata in PNG since “popular platform” most likelly ditches all metadata present.

As for WebP - yeah it would be great to have metadata in it, I’ll try doing same as @ggbutcher and see which data’s present (or none at all) there :slight_smile:

There is TIFF for this, much better option.

2 Likes

I use darktable as a local compile of the git master branch, and found I can’t get a usable executable to do this little test without doing a bit of library work. Is there another dt user listening who could try a WebP export, see if metadata follows along… ?

Just to clarify….

Although I rarely use PNG, —and, yes, I can think of many use cases, but that is not the point— metadata does work with PNG, so that is not my issue. Most of the things for which I might possibly use PNG, I tend to use OpenEXR. The thing is that PNG is smaller than OpenEXR & TIFF, and TIFF is not a perfect “standard,” as not all applications use the entire standard, just the subset which they see as necessary. (Just as how DT does not see metadata in WebP as necessary???)

But all that is mostly besides the point. …Metadata is also exported to OpenEXR!

My issue is that I export to WebP quite often. It is cleaner than JPEG, and smaller than JPEG & TIFF. Eventually one day, I may be exporting to AVIF quite often. Right now, when I export to JPEG, PNG, or OpenEXR all the metadata is kept, (except the ones I told DT NOT to export). So I know the metadata export options is working, insofar as JPEG, PNG, and OpenEXR is concerned.

The issue arises where WebP is concerned. If I can fix that, I will be good. Their are certain bits of metadata which I do not want lost when files are distributed to certain end uses. I can always send them larger JPEGs, but I do notice better colour integrity in the WebP files vs the JPEGs as exported by DT.

[ASIDE]
I can actually take a lossless PNG, and export it from The GIMP as a JPEG JFIF with 4:4:4 colour and get a better (and larger file size) result, compared to DT, and have my metadata.
[/ASIDE]

Okay. I just did some tests. Part of my problem is that my viewer will show me metadata in JPEG, PNG, and OpenEXR files, but it does not show me metadata in WebP files. …So I used the CLI exiv2.

I exported a PNG, an OpenEXR, and a WebP file directly from DT, and exiv2 found no metadata in the WebP file. I then used The GIMP to export a WebP file from the PNG file, and again from the OpenEXR file, and exiv2 found some metadata in both.

So the fact that my viewer was not showing the metadata is irrelevant, because it is not there in the WebP images directly exported from DT. As a workaround, (emphasis on, “work”), I can use The GIMP, but that is not a fix.

P.s., anyone knows of a good image viewer for Linux which will show both the WebP files and the metadata therein? (I am currently using gThumb, and Deepin, neither of which show the metadata for WebP. Thanks).

My general recommendation for an image viewer is always geeqie. Not sure if it’ll meet your specific needs here…

1 Like

Just got 3.0.0 to compile, albeit without WebP (need to find that library…). Anyway, there’s a “gear” button right by the export button that brings up a dialog to select what metadata gets exported in the output image. Might check that…

Did check that. Metadata exports well with JPEG, PNG, and OpenEXR. Just does not do it with WebP.

Ookay, just recompiled with libwebp, and sure 'nuff, no EXIF metadata.

I just perused the recent darktable issues, no joy on this. I’m not a dev, but I’ll put one in, and just take the lumps if it’s something I’m not yet seeing.

1 Like

Started to write the report, then thought of something: exiv2 version? So I checked, my compile of darktable is using the Ubuntu package, which is 0.25. Latest exiv2 is 0.27, but I can’t readily tell from their changelog when they added WebP support.

exiv2 is the metadata library darktable uses for this.

1 Like

karim@Phenobuntu:~$ exiv2 --version
exiv2 0.27.2
Besides, When using The GIMP to export a WebP from the DT produced OpenEXR or PNG, I do get metadata in the WebP file from The GIMP. (Then, again, does The GIMP use exiv2, or exiftool? Let me check)….

Oh, and while I am checking, let me just say, I appreciate all the help, guys!

…They also use exiv2.

Tried Geeqie today. It does not read WebP files. :dizzy_face:

TaDa! Compiled and installed libexiv2 0.27 to /usr/local/lib. Re-built darktable from the cmake command, installed it, and this build now saves WebP with metadata. So, my surmise is the root cause is the OpenSuse version of exiv2…

Now, if you were to compile and install exiv2, I’m not sure how your OpenSuse darktable will respond to a different version of the libexiv2 shared library in /usr/local/lib. The only success bear-of-little-brain here can guarantee is if you were to compile your own versions of exiv2 and darktable…

1 Like

Okay, so something funny here. When I do, [ exiv2 --version ], I get
exiv2 0.27.2

But when I look in Synaptic, it says I have version
0.25-3.1ubuntu0.18.04.5 (bionic updates)

So, somehow, my DT must be using the older bionic version, but my CLI is using the newer installed version (from where???).

I will attempt some stuff tonight, (or likely, tomorrow), and let you know. …but this has been a BIG HELP! Thanks.

Does synaptic indicate the older version is installed?

Yes. When I try to uninstall it, it lists a large collection of tools I use, which have it listed as a dependency, (including Darktable, gThumb, Geeqie, et al).

Also, tried to download the latest exiv2, and then realised that I have done this before. It was me who installed exiv2 0.27.2, from the homepage. (I think i did it as an attempted fix, but DT is apparently still using the 0.25 version).