From b40e942aeddcb61eb3d9409025be191bcfe09a08 Mon Sep 17 00:00:00 2001 From: David Capello Date: Mon, 29 Aug 2016 18:24:03 -0300 Subject: [PATCH] Don't check sRGB profiles with libpng --- src/app/file/png_format.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/app/file/png_format.cpp b/src/app/file/png_format.cpp index 455efd6b1..35e1cfa76 100644 --- a/src/app/file/png_format.cpp +++ b/src/app/file/png_format.cpp @@ -100,12 +100,13 @@ bool PngFormat::onLoad(FileOp* fop) */ if (setjmp(png_jmpbuf(png_ptr))) { fop->setError("Error reading PNG file\n"); - /* Free all of the memory associated with the png_ptr and info_ptr */ png_destroy_read_struct(&png_ptr, &info_ptr, NULL); - /* If we get here, we had a problem reading the file */ return false; } + // Do not check sRGB profile + png_set_option(png_ptr, PNG_SKIP_sRGB_CHECK_PROFILE, 1); + /* Set up the input control if you are using standard C streams */ png_init_io(png_ptr, fp);