[PATCH] WebP support in Firefox, refreshed patch

274 views
Skip to first unread message

Pascal Massimino

unread,
Mar 24, 2015, 7:19:28 PM3/24/15
to WebP Discussion
Hi everyone,

on the heels of the latest 0.4.3 release, it seems like a good time to refresh
the very old patch that was initially proposed for adding WebP support in Firefox.
It had slipped quite a bit, to the point it's hard to fool around with it.

The refreshed patch is uploaded here:


and is self-contained (it includes a copy of the libwebp-0.4.3 source-tree for good measure).
It has been tested on unices and Android.

This patch has been verified to apply at changeset  235136:235a9cb26548 (~march 23rd).
It supports lossy, lossless and decodes directly into Firefox's image buffer (to avoid extra copies).
It doesn't support animation or color-profile yet.

But at least this should cover a large fraction of the webp images out there (esp. on mobile).


Enjoy!

skal/



== BUILDING ==========================================================

The build instructions for Firefox are available here:


Once mozilla-central/ directory has been clone, the patch can be applied using:

cd mozilla-central/
xzcat Firefox-mozilla-central-235a9cb26548_libwebp-0.4.3.diff.xz | patch -p1

followed by the regular build instruction:

./mach build
./mach run

se...@rambler.ru

unread,
May 1, 2015, 10:15:34 AM5/1/15
to webp-d...@webmproject.org


среда, 25 марта 2015 г., 3:19:28 UTC+4 пользователь skal написал:

This patch has been verified to apply at changeset  235136:235a9cb26548 (~march 23rd).
 
Damn how?  235136:235a9cb26548
 

mcwer...@gmail.com

unread,
Jun 18, 2015, 12:10:28 PM6/18/15
to webp-d...@webmproject.org
Actually, this patch looks very similar to what I just pulled down from BMO and I don't think it will give you a working decoder because you're missing the decoder strategy parameter from the calls. It'll also likely not build on windows (missing exported symbols, etc.).

I just happen to have applied the 0.3.0 patch myself on my browser (Pale Moon) and ran into these snags.

To help me with my effort though, can you tell me what exactly you've changed in the patch compared to the 0.3.0 one, so I know what to look for if I want to add 0.4.3 support?

MC

James Zern

unread,
Jun 18, 2015, 7:17:02 PM6/18/15
to webp-d...@webmproject.org, mcwer...@gmail.com
Hi,


On Thursday, June 18, 2015 at 9:10:28 AM UTC-7, mcwer...@gmail.com wrote:
Actually, this patch looks very similar to what I just pulled down from BMO and I don't think it will give you a working decoder because you're missing the decoder strategy parameter from the calls. It'll also likely not build on windows (missing exported symbols, etc.).

I'm not sure about windows, but webp decoding was working on linux and android with this patch. Have you tried this against the referenced revision on windows?
 

I just happen to have applied the 0.3.0 patch myself on my browser (Pale Moon) and ran into these snags.

To help me with my effort though, can you tell me what exactly you've changed in the patch compared to the 0.3.0 one, so I know what to look for if I want to add 0.4.3 support?

The image decoding interface had changed significantly from the earlier 0.2.x patch and this one from what I remember. There were some build file differences as well, but I don't think I can give specifics at this point. The bulk of this patch is the webp library snapshot, if you prune that out you should be able to get at the important bits.

Moonchild

unread,
Jun 19, 2015, 2:14:56 PM6/19/15
to webp-d...@webmproject.org
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi!

On 19/06/2015 01:17, James Zern wrote:
>
> I'm not sure about windows, but webp decoding was working on linux and
> android with this patch. Have you tried this against the referenced
> revision on windows?

The thing is, I'd be surprised if this worked on that revision - I haven't
tried it and it may be a graceful failure on unices, but it seems to be
missing what was introduced in FF 29 here:
https://bugzilla.mozilla.org/show_bug.cgi?id=896268

Without the "decoderstrategy" even if it's not *actually* used in the
functions in images/decoders/*.cpp, you're likely going to just get an error
back when trying to load a webp (at least that is what happened for me on
the Windows build).
Windows will also need symbols defined in layout/media/symbols.def.in or
you'll have unresolved externals when linking libevil... I mean libxul.

> The image decoding interface had changed significantly from the earlier
> 0.2.x patch and this one from what I remember. There were some build
> file differences as well, but I don't think I can give specifics at this
> point. The bulk of this patch is the webp library snapshot, if you prune
> that out you should be able to get at the important bits.

Thanks, I'll just do that and examine the differences in the decoder
interface functions (if any) in nsWebpDecoder.cpp/h, which was my main
question. My build system files are different anyway since I'm not using
Mozilla's current build system.

Regards,
MC
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (MingW32)

iEYEARECAAYFAlWEXB4ACgkQ2TLZrDX4ZcZpgQCdHhj8Cahjuf27omzwpkXwZNfS
9E8AoIttR5Bk/L9ijl6yknedYaFqgF0o
=Ko18
-----END PGP SIGNATURE-----

James Zern

unread,
Jun 19, 2015, 5:35:34 PM6/19/15
to webp-d...@webmproject.org, mcwer...@gmail.com


On Friday, June 19, 2015 at 11:14:56 AM UTC-7, Moonchild wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi!

On 19/06/2015 01:17, James Zern wrote:
>
> I'm not sure about windows, but webp decoding was working on linux and
> android with this patch. Have you tried this against the referenced
> revision on windows?

The thing is, I'd be surprised if this worked on that revision - I haven't
tried it and it may be a graceful failure on unices, but it seems to be
missing what was introduced in FF 29 here:
https://bugzilla.mozilla.org/show_bug.cgi?id=896268

Without the "decoderstrategy" even if it's not *actually* used in the
functions in images/decoders/*.cpp, you're likely going to just get an error
back when trying to load a webp (at least that is what happened for me on
the Windows build).

I believe that param is gone [1][2].
 
Windows will also need symbols defined in layout/media/symbols.def.in or
you'll have unresolved externals when linking libevil... I mean libxul.

Seems likely given the other contents of that file, but as I said I haven't set up a windows build.
 

> The image decoding interface had changed significantly from the earlier
> 0.2.x patch and this one from what I remember. There were some build
> file differences as well, but I don't think I can give specifics at this
> point. The bulk of this patch is the webp library snapshot, if you prune
> that out you should be able to get at the important bits.

Thanks, I'll just do that and examine the differences in the decoder
interface functions (if any) in nsWebpDecoder.cpp/h, which was my main
question. My build system files are different anyway since I'm not using
Mozilla's current build system.


[1] changeset:   222733:b4cdc04f6555
user:        Seth Fowler 
date:        Thu Jan 08 00:04:31 2015 -0800
files:       image/decoders/nsBMPDecoder.cpp image/decoders/nsBMPDecoder.h image/decoders/nsGIFDecoder2.cpp image/decoders/nsGIFDecoder2.h image/decoders/nsICODecoder.cpp image/decoders/nsICODecoder.h image/decoders/nsIconDecoder.cpp image/decoders/nsIconDecoder.h image/decoders/nsJPEGDecoder.cpp image/decoders/nsJPEGDecoder.h image/decoders/nsPNGDecoder.cpp image/decoders/nsPNGDecoder.h image/src/DecodePool.cpp image/src/DecodePool.h image/src/Decoder.cpp image/src/Decoder.h image/src/RasterImage.cpp image/src/RasterImage.h
description:
Bug 1116733 (Part 2) - Remove DecodeStrategy and frame allocation handling outside of Decoder. r=tn


xunxu...@gmail.com

unread,
Jul 17, 2015, 8:02:02 PM7/17/15
to webp-d...@webmproject.org
After https://bugzilla.mozilla.org/show_bug.cgi?id=1117607 patches land in m-c, this will break the webp patches, could you refresh the patches again, skal?

Thanks.

在 2015年3月25日星期三 UTC+8上午7:19:28,skal写道:
Reply all
Reply to author
Forward
0 new messages