Permalink
Browse files

add png patches

  • Loading branch information...
1 parent ae44307 commit 734ab50a0b364f1bf3d1066d3e3e409503317e44 @microcai committed Dec 2, 2011
@@ -1,2 +1,4 @@
+AUX synfig_libpng14.patch 791 RMD160 f61a3be307c50d4ef5a5c2c0fe15af21d6fbf30d SHA1 8f5d3945e0b14636c5a617f073be644d82b54098 SHA256 9188773048a5f44d3649824698d0c9397210875ef35673439e738970b8650bab
+AUX synfig_libpng15.patch 2111 RMD160 9c9c5e8d2f5cb3bda51a9e98b7d263a0c8c81eb3 SHA1 a429afc4ceb92633e7e675fb34e413cb1dc1ced2 SHA256 74c8edbabbb209e6243e5f18ca278d07a8fcb5e7ebdb6bab92ff5f55aae59bc0
DIST synfig-0.63.02.tar.gz 3484273 RMD160 23ca76e25cd4d1dfb4162c868a53a3a505420e8f SHA1 c7dfb92812abb8dba94538546e15a0725effac36 SHA256 7238ccc16ffbcee35754dc394dda6b4828c2ac54ed7020772d0110ce596af852
EBUILD synfig-0.63.02.ebuild 1314 RMD160 ef0e8689f5de299b4abb4516b281781da4dd8a24 SHA1 7aa7bad9f494db0d2fe8d9e98f32fac8dd6d250e SHA256 3654ff09efea713c9c75fad1e739affa92e64882f7703452f0353f68198e667b
@@ -0,0 +1,20 @@
+*** src/modules/mod_png/mptr_png.cpp.old 2010-06-24 17:12:13.108466453 +0200
+--- src/modules/mod_png/mptr_png.cpp 2010-06-24 17:13:14.333341937 +0200
+***************
+*** 309,315 ****
+ float b=gamma().b_U8_to_F32((unsigned char)png_ptr->palette[row_pointers[y][x]].blue);
+ float a=1.0;
+ if(info_ptr->valid & PNG_INFO_tRNS)
+! a = (float)(unsigned char)png_ptr->trans[row_pointers[y][x]]*(1.0/255.0);
+ surface_buffer[y][x]=Color(
+ r,
+ g,
+--- 309,315 ----
+ float b=gamma().b_U8_to_F32((unsigned char)png_ptr->palette[row_pointers[y][x]].blue);
+ float a=1.0;
+ if(info_ptr->valid & PNG_INFO_tRNS)
+! a = (float)(unsigned char)png_ptr->trans_alpha[row_pointers[y][x]]*(1.0/255.0);
+ surface_buffer[y][x]=Color(
+ r,
+ g,
+
@@ -0,0 +1,50 @@
+--- synfig-0.63.02.orig//src/modules/mod_png/mptr_png.cpp
++++ synfig-0.63.02/src/modules/mod_png/mptr_png.cpp
+@@ -304,12 +304,21 @@ png_mptr::png_mptr(const char *file_name
+ for(y=0;y<height;y++)
+ for(x=0;x<width;x++)
+ {
+- float r=gamma().r_U8_to_F32((unsigned char)png_ptr->palette[row_pointers[y][x]].red);
+- float g=gamma().g_U8_to_F32((unsigned char)png_ptr->palette[row_pointers[y][x]].green);
+- float b=gamma().b_U8_to_F32((unsigned char)png_ptr->palette[row_pointers[y][x]].blue);
++ png_colorp palette;
++ int num_palette;
++ png_get_PLTE(png_ptr, info_ptr, &palette, &num_palette);
++ float r=gamma().r_U8_to_F32((unsigned char)palette[row_pointers[y][x]].red);
++ float g=gamma().g_U8_to_F32((unsigned char)palette[row_pointers[y][x]].green);
++ float b=gamma().b_U8_to_F32((unsigned char)palette[row_pointers[y][x]].blue);
+ float a=1.0;
+- if(info_ptr->valid & PNG_INFO_tRNS)
+- a = (float)(unsigned char)png_ptr->trans_alpha[row_pointers[y][x]]*(1.0/255.0);
++ if(png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS))
++ {
++ png_bytep trans_alpha;
++ int num_trans;
++ png_color_16p trans_color;
++ png_get_tRNS(png_ptr, info_ptr, &trans_alpha, &num_trans, &trans_color);
++ a = (float)(unsigned char)trans_alpha[row_pointers[y][x]]*(1.0/255.0);
++ }
+ surface_buffer[y][x]=Color(
+ r,
+ g,
+--- synfig-0.63.02.orig//src/modules/mod_png/trgt_png.cpp
++++ synfig-0.63.02/src/modules/mod_png/trgt_png.cpp
+@@ -61,7 +61,7 @@ SYNFIG_TARGET_SET_CVS_ID(png_trgt,"$Id$"
+ void
+ png_trgt::png_out_error(png_struct *png_data,const char *msg)
+ {
+- png_trgt *me=(png_trgt*)png_data->error_ptr;
++ png_trgt *me=(png_trgt*) png_get_error_ptr(png_data);
+ synfig::error(strprintf("png_trgt: error: %s",msg));
+ me->ready=false;
+ }
+@@ -69,7 +69,7 @@ png_trgt::png_out_error(png_struct *png_
+ void
+ png_trgt::png_out_warning(png_struct *png_data,const char *msg)
+ {
+- png_trgt *me=(png_trgt*)png_data->error_ptr;
++ png_trgt *me=(png_trgt*) png_get_error_ptr(png_data);
+ synfig::warning(strprintf("png_trgt: warning: %s",msg));
+ me->ready=false;
+ }
+

0 comments on commit 734ab50

Please sign in to comment.