projects
/
synfig.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix for libpng-1.4.
[synfig.git]
/
synfig-core
/
src
/
modules
/
mod_png
/
mptr_png.cpp
diff --git
a/synfig-core/src/modules/mod_png/mptr_png.cpp
b/synfig-core/src/modules/mod_png/mptr_png.cpp
index
ec601b5
..
d85a59f
100644
(file)
--- a/
synfig-core/src/modules/mod_png/mptr_png.cpp
+++ b/
synfig-core/src/modules/mod_png/mptr_png.cpp
@@
-309,7
+309,11
@@
png_mptr::png_mptr(const char *file_name)
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)
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)
+#if (PNG_LIBPNG_VER_MAJOR > 1) || ((PNG_LIBPNG_VER_MAJOR == 1) && (PNG_LIBPNG_VER_MINOR >= 4))
+ a = (float)(unsigned char)png_ptr->trans_alpha[row_pointers[y][x]]*(1.0/255.0);
+#else
a = (float)(unsigned char)png_ptr->trans[row_pointers[y][x]]*(1.0/255.0);
a = (float)(unsigned char)png_ptr->trans[row_pointers[y][x]]*(1.0/255.0);
+#endif
surface_buffer[y][x]=Color(
r,
g,
surface_buffer[y][x]=Color(
r,
g,