Bug on colors when loading bitmap file
まだ誰も着手していません。
- 主要言語
- C
- スター
- 40.4k
- フォーク
- 8.2k
- 平均マージ
- 2日 13時間
- マージ済み PR(30日)
- 96
説明
Description
Hello,
On some bitmap files, i saw that the color of pixels got with imagecreatefrombmp/imagecolorat/imagecolorsforindex are not the correct one.
To reproduce the issue, just load the image in attachment :
$bmp = imagecreatefrombmp($bitmapFilePath);
then read the color of the pixel in 0,0 :
$rgb = imagecolorat($bmp, 0, 0);
$px = imagecolorsforindex($bmp, $rgb);
You will have the color 0, 248, 0 (green) but the color should be 255,0,255 (magenta).
The bitmap file is correctly displayed on my OS (ubuntu) and in gimp software.
Here is my php version :
PHP 8.1.2-1ubuntu2.11 (cli) (built: Feb 22 2023 22:56:18) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.2, Copyright (c) Zend Technologies
with Zend OPcache v8.1.2-1ubuntu2.11, Copyright (c), by Zend Technologies
PHP Version
8.1.2
Operating System
Ubuntu 22.04.2 LTS
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
添付された bg1.zip ファイルを使用し、imagecreatefrombmp() で報告内容を再現してから、ピクセル 0,0 に対して imagecolorat() と imagecolorsforindex() が返す値を調べます。これらのエントリポイントからビットマップの読み込み経路を追跡し、観測された RGB 値を期待されるマゼンタ値と比較します。報告されたビットマップの色が正しくデコードされれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- c, php
- 領域
- computer-graphics
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100