X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-core%2Fsrc%2Fmodules%2Fmod_png%2Fmptr_png.cpp;h=d85a59f28506faa84da5f9fdaabcd17a695ba7a6;hb=refs%2Fheads%2Flibpng-1.4-fix;hp=19f82f35880b1edb0b9203134103fbfd1bb82d47;hpb=adfc80c126f482d7ea2bac38001a2c4a7c7df88c;p=synfig.git diff --git a/synfig-core/src/modules/mod_png/mptr_png.cpp b/synfig-core/src/modules/mod_png/mptr_png.cpp index 19f82f3..d85a59f 100644 --- 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) +#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); +#endif surface_buffer[y][x]=Color( r, g, @@ -334,7 +338,7 @@ png_mptr::png_mptr(const char *file_name) trim = false; - if (getenv("SYNFIG_DISABLE_CROP_IMPORTED_IMAGES")) + //if (getenv("SYNFIG_DISABLE_CROP_IMPORTED_IMAGES")) return; switch(color_type) @@ -407,7 +411,7 @@ png_mptr::~png_mptr() } bool -png_mptr::get_frame(synfig::Surface &surface,Time, synfig::ProgressCallback */*cb*/) +png_mptr::get_frame(synfig::Surface &surface, const synfig::RendDesc &renddesc, Time, synfig::ProgressCallback */*cb*/) { //assert(0); // shouldn't be called? surface=surface_buffer; @@ -415,7 +419,7 @@ png_mptr::get_frame(synfig::Surface &surface,Time, synfig::ProgressCallback */*c } bool -png_mptr::get_frame(synfig::Surface &surface,Time, +png_mptr::get_frame(synfig::Surface &surface, const synfig::RendDesc &renddesc, Time, bool &trimmed, unsigned int &width, unsigned int &height, unsigned int &top, unsigned int &left, synfig::ProgressCallback */*cb*/) {