Bug 301089
| Summary: | [GTK][WPE] Add WebKitImage utility class to the public API | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Adrian Perez <aperez> |
| Component: | WebKitGTK | Assignee: | Simon Pena <spena> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | bugs-noreply, jmurphy, mcatanzaro |
| Priority: | P2 | ||
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Bug Depends on: | |||
| Bug Blocks: | 301086 | ||
Adrian Perez
The goal is to use it as representation of site icons (favicons) and WebExtension icons. Here's the list of requirements, extracted from bug #301086:
- It least it needs to allow querying width, height, stride, and provide a method to obtain a GBytes wrapping a buffer with 32bpp RGBA/BGRA pixels.
- Implementing the GIcon and GLoadableIcon interfaces would be desirable.
- For the GTK port, it may have a method to obtain a GdkTexture out of it, for the sake of convenience (optional?).
- Provide a nullable “url” property which may be filled with the URL from which the image was loaded (doubtful: would it better belong in a WebKitFavicon subclass?)
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Jamie Murphy
One thing I'd like to see if possible would be the ability to scale an image, as the WebExtensions code does have the capability of resizing an image to fit a better screen size. Implementing GIcon would be desirable, yes, and WebExtensions already uses GIcon so this makes it easier on the API side to port.
I don't think the "url" property would be super useful for the overall class, it should be added to a sublcass. While extensions do have a concept of a URL that the image could be loaded from, it doesn't really make sense to expose that unless the extension itself wants to.
Michael Catanzaro
Subclasses are complex, though. If it's really useful to have subclasses, then OK. But otherwise we should avoid it.
Jamie Murphy
I don't think the property is useful for WebExtensions usage, but if it's more difficult to use a subclass, we could include it and just document that it's not used with WebExtensions
Simon Pena
Pull request: https://github.com/WebKit/WebKit/pull/52767
Adrian Perez
Pull request: https://github.com/WebKit/WebKit/pull/53480
EWS
Committed 302720@main (f53dba1d3a1d): <https://commits.webkit.org/302720@main>
Reviewed commits have been landed. Closing PR #52767 and removing active labels.