On Sat, 19 Feb 2011, Enlightenment SVN wrote:

> Log:
> png loader: do not hit "interlaced" member of the png ptr struct
>
>  this should work with libpng 1.[245].x ... did not check anything older than 
> that though

maybe this patch should also go into evas_image_save_png.c (trunk and 1.0 
branch, with changelog :p)

Vincent

>
>  patch by Thomas Klausner
>
> Author:       vapier
> Date:         2011-02-19 11:33:58 -0800 (Sat, 19 Feb 2011)
> New Revision: 57171
> Trac:         http://trac.enlightenment.org/e/changeset/57171
>
> Modified:
>  trunk/imlib2/src/modules/loaders/loader_png.c
>
> Modified: trunk/imlib2/src/modules/loaders/loader_png.c
> ===================================================================
> --- trunk/imlib2/src/modules/loaders/loader_png.c     2011-02-19 19:23:57 UTC 
> (rev 57170)
> +++ trunk/imlib2/src/modules/loaders/loader_png.c     2011-02-19 19:33:58 UTC 
> (rev 57171)
> @@ -238,7 +238,7 @@
>    png_structp         png_ptr;
>    png_infop           info_ptr;
>    DATA32             *ptr;
> -   int                 x, y, j;
> +   int                 x, y, j, interlace;
>    png_bytep           row_ptr, data = NULL;
>    png_color_8         sig_bit;
>    int                 pl = 0;
> @@ -274,11 +274,11 @@
>      }
>
>    /* check whether we should use interlacing */
> +   interlace = PNG_INTERLACE_NONE;
>    if ((tag = __imlib_GetTag(im, "interlacing")) && tag->val)
>      {
> #ifdef PNG_WRITE_INTERLACING_SUPPORTED
> -          png_ptr->interlaced = PNG_INTERLACE_ADAM7;
> -          num_passes = png_set_interlace_handling(png_ptr);
> +          interlace = PNG_INTERLACE_ADAM7;
> #endif
>      }
>
> @@ -286,7 +286,7 @@
>    if (im->flags & F_HAS_ALPHA)
>      {
>         png_set_IHDR(png_ptr, info_ptr, im->w, im->h, 8,
> -                     PNG_COLOR_TYPE_RGB_ALPHA, png_ptr->interlaced,
> +                     PNG_COLOR_TYPE_RGB_ALPHA, interlace,
>                      PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE);
> #ifdef WORDS_BIGENDIAN
>         png_set_swap_alpha(png_ptr);
> @@ -297,7 +297,7 @@
>    else
>      {
>         png_set_IHDR(png_ptr, info_ptr, im->w, im->h, 8, PNG_COLOR_TYPE_RGB,
> -                     png_ptr->interlaced, PNG_COMPRESSION_TYPE_BASE,
> +                     interlace, PNG_COMPRESSION_TYPE_BASE,
>                      PNG_FILTER_TYPE_BASE);
>         data = malloc(im->w * 3 * sizeof(char));
>      }
> @@ -344,6 +344,10 @@
>    png_set_shift(png_ptr, &sig_bit);
>    png_set_packing(png_ptr);
>
> +#ifdef PNG_WRITE_INTERLACING_SUPPORTED
> +   num_passes = png_set_interlace_handling(png_ptr);
> +#endif
> +
>    for (pass = 0; pass < num_passes; pass++)
>      {
>       ptr = im->data;
>
>
> ------------------------------------------------------------------------------
> The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
> Pinpoint memory and threading errors before they happen.
> Find and fix more than 250 security defects in the development cycle.
> Locate bottlenecks in serial and parallel code that limit performance.
> http://p.sf.net/sfu/intel-dev2devfeb
> _______________________________________________
> enlightenment-svn mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/enlightenment-svn
>
>

------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to