X-Git-Url: https://cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Ffilepng.C;h=f4b09d7d178f65dd7a473ea2b40aa2217e41a6bb;hb=bd7011a86f60b4ef1abf11e2667373eba3a98c99;hp=4df95f1e3fa41dd7a163d202650cfd07c803f632;hpb=8c43913b9f18a3856bbff826aef96587a32f0470;p=goodguy%2Fcinelerra.git diff --git a/cinelerra-5.1/cinelerra/filepng.C b/cinelerra-5.1/cinelerra/filepng.C index 4df95f1e..f4b09d7d 100644 --- a/cinelerra-5.1/cinelerra/filepng.C +++ b/cinelerra-5.1/cinelerra/filepng.C @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -228,10 +229,8 @@ int FilePNG::write_frame(VFrame *frame, VFrame *data, FrameWriterUnit *unit) png_set_IHDR(png_ptr, info_ptr, asset->width, asset->height, asset->png_depth, asset->png_use_alpha ? PNG_COLOR_TYPE_RGB_ALPHA : PNG_COLOR_TYPE_RGB, PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT); -// does not work (gg 2020/03/17 libpng16 fc31) - if( asset->png_depth == 16 && BC_Resources::little_endian ) - png_set_swap(png_ptr); png_write_info(png_ptr, info_ptr); + if( BC_Resources::little_endian ) png_set_swap(png_ptr); png_write_image(png_ptr, output_frame->get_rows()); png_write_end(png_ptr, info_ptr); result = 0; @@ -260,7 +259,13 @@ int FilePNG::read_frame(VFrame *output, VFrame *input) //printf("FilePNG::read_frame 1 %d %d\n", native_cmodel, output->get_color_model()); png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, 0, 0, 0); + if(!png_ptr) return 0; info_ptr = png_create_info_struct(png_ptr); + if(!info_ptr) return 0; + if (setjmp(png_jmpbuf(png_ptr))) { + png_destroy_read_struct(&png_ptr, &info_ptr, NULL); + return 0; + } png_set_read_fn(png_ptr, input, (png_rw_ptr)read_function); png_read_info(png_ptr, info_ptr); @@ -355,6 +360,8 @@ PNGConfigVideo::PNGConfigVideo(BC_WindowBase *parent_window, Asset *asset) compression = 0; depth8 = 0; depth16 = 0; +// *** CONTEXT_HELP *** + context_help_set_keyword("Single File Rendering"); } PNGConfigVideo::~PNGConfigVideo()