Bug #80335 [NEW]: Imagecolorat and imagecreatefrompng glitch

From: Date: Sun, 08 Nov 2020 01:16:32 +0000
Subject: Bug #80335 [NEW]: Imagecolorat and imagecreatefrompng glitch
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-230180@lists.php.net to get a copy of this message
From: jagja870 at school dot lu Operating system: Windows 10 PHP version: 7.3.24 Package: *Graphics related Bug Type: Bug Bug description:Imagecolorat and imagecreatefrompng glitch Description: ------------ if you create an image source from an image file, with imagecreatefrompng($path) $path leads to a png image you will come to a bug, where if u use imagecolorat() will always return an rgb value of 0. but if you change it to imgcreatefromstring($path) and load the png file it also won't work. imagecolorat() only works with jpg files in the end. Test script: --------------- $imageSource = file_get_contents("uploads/"."myfile.png"); $imageSource = imagecreatefrompng($imageSource); for($x=0; $x<$imageX;$x++){ for($y=0;$y<$imageY;$y++){ $rgb = imagecolorat($imageSource, $x, $y); } } Expected result: ---------------- All returns get a value of 0. Actual result: -------------- The actual result should have returned the rgb value of the pixel in a png file. -- Edit bug report at https://bugs.php.net/bug.php?id=80335&edit=1 -- Fix committed: https://bugs.php.net/fix.php?id=80335&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=80335&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=80335&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=80335&r=needscript Try newer version: https://bugs.php.net/fix.php?id=80335&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=80335&r=support Expected behavior: https://bugs.php.net/fix.php?id=80335&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=80335&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=80335&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=80335&r=globals PHP version support discontinued: https://bugs.php.net/fix.php?id=80335&r=phptooold Daylight Savings: https://bugs.php.net/fix.php?id=80335&r=dst IIS Stability: https://bugs.php.net/fix.php?id=80335&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=80335&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=80335&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=80335&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=80335&r=mysqlcfg

« previous php.bugs (#230180) next »