|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #60830 Issue with getColor
Submitted: 2012-01-21 08:20 UTC Modified: 2021-03-03 14:15 UTC
From: fedora at famillecollet dot com Assigned: cmb (profile)
Status: Closed Package: gmagick (PECL)
PHP Version: 5.4.0RC6 OS: GNU/Linux (Fedora 16)
Private report: No CVE-ID: None
 [2012-01-21 08:20 UTC] fedora at famillecollet dot com
GraphicsMagick accept a --with-quantum-depth which define the color representation

Default : 8, which means RGB value are in range [0..255]

Starting with fedora 16

Used : 16, which means RGB value are in range [0..65535] 

So there is 6 tests which fail, because getColor returns rgb(65535,65535,65535)

I don't what is the good solution ?
- fix the test suite ?
- fix the getColor fonction to mimic the old behavior and still return [0..255] value ?

Of course, I could help, at least testing, or proposing a patch

Test script:
php -r '$color = "rgb(255,255,255)"; $pixel = new GmagickPixel($color); var_dump($pixel->getColor());'

Expected result:
string(16) "rgb(255,255,255)"

Actual result:
string(22) "rgb(65535,65535,65535)"


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2012-01-22 19:39 UTC]
-Status: Open +Status: Assigned -Assigned To: +Assigned To: mkoppanen
 [2012-01-23 07:58 UTC] fedora at famillecollet dot com
Well, after some thinking: this extension is a wrapper, so should keep the standard library behavior.

Yes, having setColor using [0..255] and getColor retrieving [0..65535] is ugly (but its the GM upstream choice)

First patch proposal for gmagick-054-getquantumdepth.phpt
 [2013-10-19 09:28 UTC]
Automatic comment from SVN on behalf of vito
Log: #60830 Updated test for getQuantumDepth
 [2013-10-19 09:43 UTC]
-Status: Assigned +Status: Closed
 [2013-10-19 09:43 UTC]
The fix for this bug has been committed.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at

 For Windows:
Thank you for the report, and for helping us make PHP better.

 [2013-10-20 10:59 UTC]
-Status: Closed +Status: Re-Opened
 [2013-10-20 10:59 UTC]
Please keep this one open.
The path only fix gmagick-054-getquantumdepth.phpt

Still fail:
 [2017-10-24 05:17 UTC]
-Status: Re-Opened +Status: Assigned
 [2017-10-24 06:33 UTC]
-Status: Assigned +Status: Open -Assigned To: mkoppanen +Assigned To:
 [2021-03-03 14:15 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: cmb
 [2021-03-03 14:15 UTC]
Apparently, this has been fixed long ago:
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Apr 22 16:01:31 2024 UTC