WebP Exif and XMP meta fields

Started by colink, July 30, 2022, 06:16:40 PM

Previous topic - Next topic

colink

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

Jom

On page
https://exiftool.org/index.html
in table "Supported File Types" written that for this format ExifTool can only read.

Jom

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.

colink

Thanks for your reply.

Surprised that Exiftool does not write to WebP

Phil Harvey

It's near the top of my list to look into when I get a block of free time.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

colink

Thanks for your confirmation - Phil

Phil Harvey

#6
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).
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

ajft

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

Phil Harvey

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
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

herb

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

wywh

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

Phil Harvey

@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
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

StarGeek

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.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

Phil Harvey

ExifTool 12.46 is now available with the ability to add/delete/edit EXIF, XMP and ICC_Profile in WebP images.

- Phil

...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

colink

Great news. Thanks for your continued work on ExifTool