From d0d2eb9f0ad5d0bfbd1d723c7e8d97d1f582cd43 Mon Sep 17 00:00:00 2001 From: yixy <34703796+yixy-only@users.noreply.github.com> Date: Tue, 30 Apr 2024 21:25:03 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E5=B1=8F=E8=94=BD=20"libpng=20warning?= =?UTF-8?q?:=20iCCP:=20known=20incorrect=20sRGB=20profile"=20=E8=AD=A6?= =?UTF-8?q?=E5=91=8A=20(#158)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/image.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/image.cpp b/src/image.cpp index df4eac2f..e482727b 100644 --- a/src/image.cpp +++ b/src/image.cpp @@ -495,6 +495,11 @@ void getimage_from_png_struct(PIMAGE self, void* vpng_ptr, void* vinfo_ptr) png_structp png_ptr = (png_structp)vpng_ptr; png_infop info_ptr = (png_infop)vinfo_ptr; + #if defined(PNG_SKIP_sRGB_CHECK_PROFILE) && defined(PNG_SET_OPTION_SUPPORTED) + png_set_option(png_ptr, PNG_SKIP_sRGB_CHECK_PROFILE, + PNG_OPTION_ON); + #endif + // 读取 PNG 文件信息, 存入 info_ptr 中 png_read_info(png_ptr, info_ptr);