Bug on colors when loading bitmap file
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- C
- Sterne
- 40.4k
- Forks
- 8.2k
- Ø Merge
- 2 T. 13 Std.
- Gemergte PRs (30 T.)
- 96
Beschreibung
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
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Reproduziere den Bericht mit der angehängten Datei bg1.zip unter Verwendung von imagecreatefrombmp() und untersuche anschließend die von imagecolorat() und imagecolorsforindex() für das Pixel 0,0 zurückgegebenen Werte. Verfolge den Bitmap-Ladepfad von diesen Einstiegspunkten aus und vergleiche die beobachteten RGB-Werte mit dem erwarteten Magenta-Wert; abgeschlossen ist die Aufgabe, wenn die gemeldete Bitmap-Farbe korrekt dekodiert wird.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- c, php
- Bereich
- computer-graphics
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100