Suppress Warnings From libpng
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 新手友好度
- 55/100
- Issue 類型
- 功能
- 描述清晰度
- 基本清楚
- 活躍度
- 活躍
研究方向
首先定位 imagecreatefrompng 背後的 GD 實作及其對 libpng 警告的處理。檢查現有 PHP GD API 如何公開影像載入行為,以及相關測試是否涵蓋警告。完成標準是提供所要求的切換 libpng 警告的方式,包括可選的狀態查詢,並為提供的無效 profile 情況加入涵蓋。
由索引模型根據 Issue 內容生成。
描述
Description
PNG files exported from some applications, most notably Photoshop, are written with an sRGB profile that libpng sees as invalid. Any attempt to load a file like this using the GD library causes a warning to be written to the PHP error log. It is not possible to suppress this warning.
The following code:
<?php
$image = imagecreatefrompng('clouds.png');
Results in this warning:
Warning: imagecreatefrompng(): gd-png: libpng warning: iCCP: known incorrect sRGB profile
Please see the attached file as an example of one that has the issue.
The only solution I have found so far is to post-process the PNG to remove the sRGB profile. This is not ideal for workflow with large numbers of files. Whilst it is possible to disable all warnings, they are often on in production so this is not a desirable solution.
I would like a method to suppress all libpng warnings. This could be implemented as a gd_ prefixed method that takes an optional bool parameter to toggle warnings on or off. If no parameter is passed it could return the current state.
- 主要語言
- C
- 星號
- 40.4k
- 分支
- 8.2k
- 平均合併
- 2 天 11 小時
- 30 天內合併 PR
- 116
環境準備
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
php/php-src 的其他 Issue
-
Bug Status: Needs Triage
難度 2/5 1-3 小時 新手友好度 76/100
維護者通常 1 天內回覆
-
Bug Status: Needs Triage
難度 1/5 1 小時以內 新手友好度 90/100
維護者通常 1 天內回覆
-
Bug Status: Needs Triage
難度 2/5 1-3 小時 新手友好度 78/100
維護者通常 1 天內回覆
-
Bug Category: Tests Status: Verified
難度 2/5 1-3 小時 新手友好度 68/100
維護者通常 1 天內回覆
-
Bug SAPI: fpm Status: Needs Triage
難度 2/5 1-3 小時 新手友好度 65/100
php/php-src#21740 · 1 個 reaction ·
維護者通常 1 天內回覆
相似的 Issue
-
bug
難度 2/5 1-3 小時 新手友好度 76/100
johnsonjh/emu2-cpm86#68 · 1 則留言 ·
維護者通常 1 天內回覆
-
Zenmap Crash未關閉Zenmap
難度 2/5 1-3 小時 新手友好度 68/100
維護者通常 2 天內回覆
-
難度 2/5 1-3 小時 新手友好度 72/100
BasedHardware/omi#19306 ·
維護者通常 1 天內回覆
-
難度 1/5 1 小時以內 新手友好度 88/100
fastfetch-cli/fastfetch#2619 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 82/100