ExifTool Forum

ExifTool => Bug Reports / Feature Requests => Topic started by: colink on July 30, 2022, 06:16:40 PM

Title: WebP Exif and XMP meta fields
Post by: colink on July 30, 2022, 06:16:40 PM
I have previously used Exiftool to write meta data to JPG images, hoping to do the same for WebP images.

I understand WebP cannot store as many mete data fields as JPEG. Is that correct?

Could someone give me a link to a list of Exif and XMP fields that can be written to WebP images?

Ideally a table comparing jpeg to WebP would be useful.

I have searched but cannot find clear answers.

Thanks ColinK
Title: Re: WebP Exif and XMP meta fields
Post by: Jom on July 30, 2022, 06:49:33 PM
On page
https://exiftool.org/index.html
in table "Supported File Types" written that for this format ExifTool can only read.
Title: Re: WebP Exif and XMP meta fields
Post by: Jom on July 30, 2022, 07:04:26 PM
Additionally, here
https://developers.google.com/speed/webp/docs/riff_container?hl=en#metadata
I didn't find any explicit tag restrictions for Exif and XMP.
Title: Re: WebP Exif and XMP meta fields
Post by: colink on July 31, 2022, 07:47:02 PM
Thanks for your reply.

Surprised that Exiftool does not write to WebP
Title: Re: WebP Exif and XMP meta fields
Post by: Phil Harvey on July 31, 2022, 09:27:09 PM
It's near the top of my list to look into when I get a block of free time.

- Phil
Title: Re: WebP Exif and XMP meta fields
Post by: colink on August 02, 2022, 10:42:28 AM
Thanks for your confirmation - Phil
Title: Re: WebP Exif and XMP meta fields
Post by: Phil Harvey on September 26, 2022, 01:15:13 PM
I have a working test version of ExifTool 12.46 that writes XMP and EXIF to WebP images.  So far the tests are going well, but the only viewer I have for WebP is FireFox, and the current version of FireFox for Macos (version 105.0.1) seems to be a bit flakey.  It gives this error seemingly just because it doesn't like the size of the XMP metadata:

The image "bad.webp" cannot be displayed because it contains errors
Attached are WebP files that are both good and bad according to FireFox.  The only difference should be a single space in the XMP padding.

It would be useful if someone could test these independently.

TIA

- Phil

Edit:  Right.  I figured it out.  The leading RIFF chunk specifies the entire file size, and I wasn't updating that.  Ouch.  This will be a real PITA to fix (because ExifTool supports reading/writing non-seekable streams, this means that the entire file will have to be buffered in memory).
Title: Re: WebP Exif and XMP meta fields
Post by: ajft on September 27, 2022, 09:57:27 PM
Quote from: Phil Harvey on September 26, 2022, 01:15:13 PM:
The image "bad.webp" cannot be displayed because it contains errors
Attached are WebP files that are both good and bad according to FireFox.  The only difference should be a single space in the XMP padding.

It would be useful if someone could test these independently.

TIA

- Phil

Edit:  Right.  I figured it out.  The leading RIFF chunk specifies the entire file size, and I wasn't updating that.  Ouch.  This will be a real PITA to fix (because ExifTool supports reading/writing non-seekable streams, this means that the entire file will have to be buffered in memory).
Not sure if you still need the confirmation after the edit above, can confirm that Firefox 105.0.1 on linux gives the same error message you quote for bad.webp
Title: Re: WebP Exif and XMP meta fields
Post by: Phil Harvey on September 27, 2022, 10:20:06 PM
Thanks. Yes, that was definitely the issue.

I've fixed that now and I've found no other glitches.  The patch requires 2 read passes of the input image, so the entire image will be buffered in memory if reading from a non-seekable input stream.

I'm also going to look into adding the ability to write ICC Profiles before the next release.

- Phil
Title: Re: WebP Exif and XMP meta fields
Post by: herb on October 01, 2022, 04:18:29 AM
Hello Phil,

thanks for your work on WEBP in advance.
And sorry, that I hijack this thread, but I have a question to encoding of metadata:
- for XMP it is clear; it is UTF8
- but what charset is to be used for other metadata in a *.webp image

You wrote: WEBP is RIFF based;
So what charset should be used for EXIF-metadata and other (e.g. RIFF):
-charset EXIF=value or -charset RIFF=value or maybe both

Thanks for your comment in advance

Best regards
herb
Title: Re: WebP Exif and XMP meta fields
Post by: wywh on October 01, 2022, 05:05:11 AM
GraphicConverter 11.6.2 can write and display XMP-dc in .webp.

exiftool -a -G1 -s image.webp
[ExifTool]      ExifToolVersion                 : 12.42
[File]          FileType                        : WEBP
[File]          FileTypeExtension               : webp
[File]          MIMEType                        : image/webp
[RIFF]          ImageWidth                      : 640
[RIFF]          ImageHeight                     : 344
[RIFF]          VP8Version                      : 0 (bicubic reconstruction, normal loop)
[RIFF]          ImageWidth                      : 640
[RIFF]          HorizontalScale                 : 0
[RIFF]          ImageHeight                     : 344
[RIFF]          VerticalScale                   : 0
[XMP-x]         XMPToolkit                      : XMP Core 6.0.0
[XMP-dc]        Description                     : Caption
[XMP-dc]        Subject                         : Keyword 2, Keyword1

- Matti
Title: Re: WebP Exif and XMP meta fields
Post by: Phil Harvey on October 01, 2022, 07:04:58 AM
@herb: WebP specifies only XMP, EXIF and ICC metadata.  Use the same character sets as XMP and EXIF in other files.  Native RIFF metadata is not used.

I now have a version that works very well writing XMP, EXIF and ICC to WebP files.  I should be able to release this within a couple of days.  This is a big step towards adding write support for AVI and WAV files, so maybe I'll look into this next.  I may have some more time to work on this over the next week.

- Phil
Title: Re: WebP Exif and XMP meta fields
Post by: StarGeek on October 01, 2022, 10:47:28 AM
Quote from: Phil Harvey on October 01, 2022, 07:04:58 AMThis is a big step towards adding write support for AVI and WAV files, so maybe I'll look into this next.

That is unexpected good news.
Title: Re: WebP Exif and XMP meta fields
Post by: Phil Harvey on October 01, 2022, 02:53:56 PM
ExifTool 12.46 is now available with the ability to add/delete/edit EXIF, XMP and ICC_Profile in WebP images.

- Phil

Title: Re: WebP Exif and XMP meta fields
Post by: colink on December 09, 2022, 09:08:24 AM
Great news. Thanks for your continued work on ExifTool
Title: Re: WebP Exif and XMP meta fields
Post by: schmekis on February 28, 2023, 04:21:36 PM
Any chance this webp update will find its way into geosetter?
Title: Re: WebP Exif and XMP meta fields
Post by: StarGeek on February 28, 2023, 06:56:31 PM
You would have to ask the author of Geosetter, but considering how silent they've been for the past few years, I would have my doubts.

You can replace the copy of exiftool that's included with Geosetter, but I don't know if Geosetter will recognize webp files or not.