Skip to content

Commit

Permalink
chore: 屏蔽 "libpng warning: iCCP: known incorrect sRGB profile" 警告 (#158)
Browse files Browse the repository at this point in the history
  • Loading branch information
yixy-only authored Apr 30, 2024
1 parent 42e6396 commit d0d2eb9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit d0d2eb9

Please sign in to comment.