Bug 33287 - PNGEncoder.cpp lacks support for libpng 1.4
Summary: PNGEncoder.cpp lacks support for libpng 1.4
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Platform (show other bugs)
Version: 528+ (Nightly build)
Hardware: Other Linux
: P5 Trivial
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-01-06 19:52 PST by John Bowler
Modified: 2010-04-29 08:47 PDT (History)
7 users (show)

See Also:


Attachments
libpng.patch (1.50 KB, patch)
2010-04-29 06:52 PDT, Pawel Hajdan jr (ph)
jorlow: review-
Details | Formatted Diff | Diff
libpng.patch (1.39 KB, patch)
2010-04-29 07:18 PDT, Pawel Hajdan jr (ph)
jorlow: review-
jorlow: commit-queue-
Details | Formatted Diff | Diff
libpng.patch (1.44 KB, patch)
2010-04-29 07:29 PDT, Pawel Hajdan jr (ph)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description John Bowler 2010-01-06 19:52:19 PST
Certain NULL macros were removed from png.h between 1.2 and 1.4, this patch fixes it (you probably want to use your favourite NULL definition, not 0).

--- chromium-4.0.251.0/third_party/WebKit/WebCore/platform/image-encoders/skia/orig/PNGImageEncoder.cpp	2009-11-19 13:39:07.000000000 -0800
+++ chromium-4.0.251.0/third_party/WebKit/WebCore/platform/image-encoders/skia/PNGImageEncoder.cpp	2009-11-19 13:39:25.000000000 -0800
@@ -130,9 +130,9 @@
     }
 
     png_struct* pngPtr = png_create_write_struct(PNG_LIBPNG_VER_STRING,
-                                                 png_voidp_NULL,
-                                                 png_error_ptr_NULL,
-                                                 png_error_ptr_NULL);
+                                                 0,
+                                                 0,
+                                                 0);
     if (!pngPtr)
         return false;
Comment 1 Peter Kasting 2010-04-28 14:00:22 PDT
I would r+ this if I were a reviewer.  Make a real patch with a ChangeLog and ask for review.  (I'd do that too, but I'm on vacation ATM.)
Comment 2 Evan Martin 2010-04-28 14:11:37 PDT
I will make this a WK patch if Paweł doesn't want to.
Comment 3 Pawel Hajdan jr (ph) 2010-04-29 06:52:54 PDT
Created attachment 54696 [details]
libpng.patch
Comment 4 Jeremy Orlow 2010-04-29 07:08:54 PDT
Comment on attachment 54696 [details]
libpng.patch

This change log would be more standard.  Note the moved url.

"""
2010-04-29  PaweÅ Hajdan, Jr.  <phajdan.jr@chromium.org>

        Reviewed by NOBODY (OOPS!).

        Fix building with libpng-1.4.
        https://bugs.webkit.org/show_bug.cgi?id=33287

        No new tests (no behavior change).

        Original patch by John Bowler <jbowler@acm.org>

        * platform/image-encoders/skia/PNGImageEncoder.cpp:
        (WebCore::PNGImageEncoder::encode):
"""


>      png_struct* pngPtr = png_create_write_struct(PNG_LIBPNG_VER_STRING,
> -                                                 png_voidp_NULL,
> -                                                 png_error_ptr_NULL,
> -                                                 png_error_ptr_NULL);
> +                                                 0,
> +                                                 0,
> +                                                 0);

Put all of these values on one line.
Comment 5 Pawel Hajdan jr (ph) 2010-04-29 07:18:44 PDT
Created attachment 54700 [details]
libpng.patch

Fixes jorlow's review comments.
Comment 6 Jeremy Orlow 2010-04-29 07:21:44 PDT
Comment on attachment 54700 [details]
libpng.patch

> Index: WebCore/ChangeLog
> ===================================================================
> --- WebCore/ChangeLog	(revision 58506)
> +++ WebCore/ChangeLog	(working copy)
> @@ -1,3 +1,17 @@
> +2010-04-29  PaweÅ Hajdan, Jr.  <phajdan.jr@chromium.org>
> +
> +        Reviewed by NOBODY (OOPS!).
> +
> +        Fix building with libpng-1.4.
> +        https://bugs.webkit.org/show_bug.cgi?id=33287
> +
> +        No new tests (no behavior change).
> +
> +        Original patch by John Bowler <jbowler@acm.org>
> +
> +        * platform/image-encoders/skia/PNGImageEncoder.cpp:
> +        (WebCore::PNGImageEncoder::encode):
> +
>  2010-04-29  Kwang Yul Seo  <skyul@company100.net>
>  
>          Reviewed by Simon Hausmann.
> Index: WebCore/platform/image-encoders/skia/PNGImageEncoder.cpp
> ===================================================================
> --- WebCore/platform/image-encoders/skia/PNGImageEncoder.cpp	(revision 58494)
> +++ WebCore/platform/image-encoders/skia/PNGImageEncoder.cpp	(working copy)
> @@ -130,9 +130,7 @@ bool PNGImageEncoder::encode(const unsig
>      }
>  
>      png_struct* pngPtr = png_create_write_struct(PNG_LIBPNG_VER_STRING,
> -                                                 png_voidp_NULL,
> -                                                 png_error_ptr_NULL,
> -                                                 png_error_ptr_NULL);
> +                                                 0, 0, 0);

Sorry I wasn't clear, but the line needs to look like this: "png_struct* pngPtr = png_create_write_struct(PNG_LIBPNG_VER_STRING, 0, 0, 0);"

The original line was not in WebKit style.
Comment 7 Pawel Hajdan jr (ph) 2010-04-29 07:29:03 PDT
Created attachment 54704 [details]
libpng.patch

No problem, please just take another look.
Comment 8 Jeremy Orlow 2010-04-29 07:30:11 PDT
Comment on attachment 54704 [details]
libpng.patch

Sweet!!
Comment 9 WebKit Commit Bot 2010-04-29 08:46:59 PDT
Comment on attachment 54704 [details]
libpng.patch

Clearing flags on attachment: 54704

Committed r58519: <http://trac.webkit.org/changeset/58519>
Comment 10 WebKit Commit Bot 2010-04-29 08:47:05 PDT
All reviewed patches have been landed.  Closing bug.