Suppress Warnings From libpng
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 55/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
調査の方向性
まず、imagecreatefrompng の背後にある GD の実装と、libpng の警告処理を探します。既存の PHP GD API が画像読み込みの動作をどのように公開しているか、また関連するテストで警告がカバーされているかを確認します。完了条件は、オプションの状態クエリを含め、libpng の警告を切り替えるために要求された方法を提供し、提示された無効なプロファイルのケースをカバーすることです。
索引モデルが 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日 17時間
- マージ済み PR(30日)
- 115
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
php/php-src のほかの issue
-
Bug Status: Needs Triage
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
Bug Status: Needs Triage
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
-
Bug Status: Needs Triage
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
Bug Category: Tests Status: Verified
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
Bug SAPI: fpm Status: Needs Triage
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
似ている issue
-
bug
難易度 1/5 1時間未満 初心者へのやさしさ 60/100
-
Nmap
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
flang:fir-hlfir
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
llvm/llvm-project#225935 ·