Subject: [media-types] image/webp rfc review

From: James Zern <[email-masked]>
Date: Thu, 29 Apr 2021 19:54:14 -0700

As a follow up to my original request [1] I drafted a rfc for the purpose
of registering image/webp [2]. I'd appreciate it if you could review the
content when you have time.

[1] https://tools.iana.org/public-view/viewticket/1187000
[2] https://datatracker.ietf.org/doc/draft-zern-webp/

---

From: Erik Wilde <[email-masked]>
Date: Mon, 3 May 2021 09:14:24 +0200

hello james.

thanks for writing up the draft!

On 2021-04-30 04:54, James Zern wrote:
> As a follow up to my original request [1] I drafted a rfc for the 
> purpose of registering image/webp [2]. I'd appreciate it if you could 
> review the content when you have time.
> 
> <https://datatracker.ietf.org/doc/draft-zern-webp/>

minor comment: maybe consider using the title "WebP Image Format 
Registration" instead, because otherwise it's easily read as being the 
actual format spec and not just the media type registration request.

cheers,

dret.

-- 
erik wilde | mailto:[email-masked] |
            | http://dret.net/netdret    |
            | http://twitter.com/dret    |

---

From: Chris Lilley <[email-masked]>
Date: Mon, 3 May 2021 08:56:15 -0400

Thanks for drafting an Internet Media type registration. Overall it 
looks good.

As already noted, the title should clarify that it is the Internet Media 
Type registration, not an RFC for the file format itself.

The section on magic numbers says

> Magic number(s): The first 4 bytes are 0x52, 0x49, 0x46, 0x46
>        ('RIFF'), followed by 4 bytes for the RIFF chunk size.  The next 7
>        bytes are 0x57, 0x45, 0x42, 0x50, 0x56, 0x50, 0x38 ('WEBPVP8').
and the introduction says
> Lossy compression is achieved using VP8 intra-frame encoding
>     [RFC6386].  The lossless algorithm [webp-lossless] stores and
>     restores the pixel values exactly
It would be helpful to clarify whether the magic number applies to both 
lossy and lossless compression, or whether there are two magic numbers 
depending on compression type.

I didn't spot anything else.

On 2021-04-29 22:54, James Zern wrote:
> [1]Â https://tools.iana.org/public-view/viewticket/1187000
> [2]Â https://datatracker.ietf.org/doc/draft-zern-webp/
>
> _______________________________________________
> media-types mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/media-types

-- 
Chris Lilley
@svgeesus
Technical Director @ W3C
W3C Strategy Team, Core Web Design
W3C Architecture & Technology Team, Core Web & Media

---

From: "Paul Libbrecht" <[email-masked]>
Date: Mon, 03 May 2021 21:16:58 +0200

Dear James,

It seems that you have taken come steps toward my wish:

> File extension(s): webp
> Macintosh file type code: UTTypeWebP com.google.webp

I am not sure what `UTTypeWebP` means (a property-list key?) but 
`com.google.webp` sounds to be an [Apple Uniform Type 
Identifier](https://developer.apple.com/library/archive/documentation/Miscellaneous/Reference/UTIRef/). 
Is that correct?

My suggestion would be that you enrich your declaration so that it 
supports interoperability for clipboard exchanges between different 
apps. For this, I believe that you have to add a uniform type identifier 
(including the “conforms to” part, declaring a parent type) and a 
windows clipboard flavour name. At best this is defined already by 
implementing applications.

I could imagine the following declaration to be sensible:

- `Macintosh Uniform Type Identifier: com.google.webp conforms to        
              public.image and to public.data.`
- `Windows Clipboard Flavour Name: WebP`

Feel free to revisit (add riff as one of the parent types?), reject, or 
consider this suggestion.

Thanks in advance.

Paul

PS: I believe that the entry `Macintosh file type code` was for the 
4-bytes code that used to be registered at Apple back then. I’ve been 
trying to push an update of the RFC6838 but haven’t yet got this to 
start.

On 30 Apr 2021, at 4:54, James Zern wrote:

> purpose

---

From: James Zern <[email-masked]>
Date: Mon, 3 May 2021 17:09:27 -0700

> actual format spec and not just the media type registration request.

That makes sense. I was using rfc 6713 as a reference, but didn't
consider the title. 'WebP Image Format Media Type Registration' could
work or in the form of 6713 it could be "The 'image/webp' Media Type".

---

From: James Zern <[email-masked]>
Date: Mon, 3 May 2021 17:33:49 -0700

Hi Paul,

On Mon, May 3, 2021 at 12:17 PM Paul Libbrecht <paul=
[email-masked]> wrote:

> I am not sure what UTTypeWebP means (a property-list key?) but
> com.google.webp sounds to be an Apple Uniform Type Identifier
> <https://developer.apple.com/library/archive/documentation/Miscellaneous/Reference/UTIRef/>.
> Is that correct?
>
Yes. I found that when looking for something as a replacement for the
deprecated Macintosh code as you mention [3]. I notice now that its value
is 'org.webmproject.webp' not 'com.google.webp', however.

> supports interoperability for clipboard exchanges between different apps.
> For this, I believe that you have to add a uniform type identifier
> (including the “conforms to” part, declaring a parent type) and a windows
> clipboard flavour name. At best this is defined already by implementing
> applications.
>
>    - Macintosh Uniform Type Identifier: com.google.webp conforms to
>    public.image and to public.data.
>
>
I think mentioning the direct relationship to public.image may be best
given you can follow it upwards past public.data. And maybe 'Apple Uniform
Type Identifier' would be more appropriate now.

>
>    - Windows Clipboard Flavour Name: WebP
>
>
I didn't see a registered reference for a standard clipboard format, but
GDI was updated to support the format with the ImageFormatWEBP GUID [4] .

> PS: I believe that the entry Macintosh file type code was for the 4-bytes
> code that used to be registered at Apple back then. I’ve been trying to
> push an update of the RFC6838 but haven’t yet got this to start.
>
[3]
https://developer.apple.com/documentation/uniformtypeidentifiers/uttypewebp/
[4]
https://docs.microsoft.com/en-us/windows/win32/gdiplus/-gdiplus-constant-image-file-format-constants

> [2] https://datatracker.ietf.org/doc/draft-zern-webp/
On Mon, May 3, 2021 at 12:17 PM Paul Libbrecht <paul=
[email-masked]> wrote:

> I am not sure what UTTypeWebP means (a property-list key?) but
> com.google.webp sounds to be an Apple Uniform Type Identifier
> <https://developer.apple.com/library/archive/documentation/Miscellaneous/Reference/UTIRef/>.
> Is that correct?
>
> supports interoperability for clipboard exchanges between different apps.
> For this, I believe that you have to add a uniform type identifier
> (including the “conforms to” part, declaring a parent type) and a windows
> clipboard flavour name. At best this is defined already by implementing
> applications.
>
>    - Macintosh Uniform Type Identifier: com.google.webp conforms to
>    public.image and to public.data.
>    - Windows Clipboard Flavour Name: WebP
>
> PS: I believe that the entry Macintosh file type code was for the 4-bytes
> code that used to be registered at Apple back then. I’ve been trying to
> push an update of the RFC6838 but haven’t yet got this to start.
>

---

From: "Paul Libbrecht" <[email-masked]>
Date: Tue, 04 May 2021 22:20:58 +0200

Hello James,

> is 'org.webmproject.webp' not 'com.google.webp', however.

Fantastic.

> Type Identifier' would be more appropriate now.

Excellent and a very good point of changing Macintosh to Apple.

> GDI was updated to support the format with the ImageFormatWEBP GUID 

I asked the person I know has been working close to that for Math and he 
indicated that GDI does not seem to contain clipboard

https://docs.microsoft.com/en-us/windows/win32/dataxchg/standard-clipboard-formats 
would be the list of standard clipboard types. And webP is not inside 
there.
I also do not find it at [this codeproject 
page](https://www.codeproject.com/reference/1091137/windows-clipboard-formats).

 From searching around about GDI and clipboard, it seems that the only 
way to copy with a GDI bitmap is to transfer it as a buffer. I would 
suspect, that it does not preserve the WebP characteristics for which 
you would need to write to a stream of bytes. All examples I found only 
copy BMP.

Thanks

Paul

---

From: James Zern <[email-masked]>
Date: Tue, 4 May 2021 18:54:31 -0700

Hi Paul,

On Tue, May 4, 2021 at 1:21 PM Paul Libbrecht <paul=
[email-masked]> wrote:

> <
> https://developer.apple.com/library/archive/documentation/Miscellaneous/Reference/UTIRef/>
> .
> Is that correct?
>

I posted a new revision with this change yesterday.

> would be the list of standard clipboard types. And webP is not inside there.
>

That is what I found too. It's not clear to me how extensive this is meant
to be since these are externally controlled values and not intrinsic to the
file format. The inclusion of the Macintosh format on its own in 6838 was
odd to me. As an identifier I would think a GUID would be closer on the
Microsoft side to the Apple identifier than anything to do with the
clipboard.

> I also do not find it at this codeproject page
> <https://www.codeproject.com/reference/1091137/windows-clipboard-formats>.
>
> From searching around about GDI and clipboard, it seems that the only way
> to copy with a GDI bitmap is to transfer it as a buffer. I would suspect,
> that it does not preserve the WebP characteristics for which you would need
> to write to a stream of bytes. All examples I found only copy BMP.
>
> Thanks
>
> Paul

---

From: "Paul Libbrecht" <[email-masked]>
Date: Wed, 05 May 2021 14:33:23 +0200

On 5 May 2021, at 3:54, James Zern wrote:
> That is what I found too. It's not clear to me how extensive this is 
> meant to be since these are externally controlled values and not 
> intrinsic to the file format.

This cannot be extensive and methods to register new formats for any 
application are offered broadly. As a result standardisation needs to 
happen somewhere else. For the clipboard, thus far, this has largely 
been bilateral.

Works on MathML makes me believe that media-types are the right place to 
contain the name of the media-type when it makes sense to exchange this 
over a clipboard (and probably through drag-and-drop). Hence I recommend 
this on this list on occasions and hope that it makes its way to the 
media-type declaration RFC.

> The inclusion of the Macintosh format on
> its own in 6838 was odd to me. As an identifier I would think a GUID 
> would be closer on the Microsoft side to the Apple identifier than 
> anything to do with the clipboard.

The inclusion of the Macintosh formats date to a time when Apple was 
controlling the (not so broad) 4-letter-codes assigned to each 
application for file-types and clipboard-formats. This has been 
abandoned.

UTIs have come as a natural replacement in the Apple world.

Paul