|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #57959 Unexpected return values when using different colorspaces
Submitted: 2007-12-09 05:33 UTC Modified: 2009-02-06 16:34 UTC
From: pascal dot duersteler at gmail dot com Assigned:
Status: No Feedback Package: imagick (PECL)
PHP Version: 5.2.1 OS: Gentoo Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
Solve the problem:
8 + 6 = ?
Subscribe to this entry?

 [2007-12-09 05:33 UTC] pascal dot duersteler at gmail dot com
Tryed Imagick::quantizeImage() which needs an Imagick::Colorspace as second argument. Strange thing is that every colorspace i choose, the return keys of an array are still r/g/b  instead of colorspace named keys like h/s/b or l/a/b for example when reading the colormap with Imagick::getColors().

Reproduce code:
// this->image comes from the class constructor
// -> $this->image = new Imagick($image);
function getColors()
    $this->image->quantizeImage( 30, Imagick::COLORSPACE_HSB, 0, false, false );

    $it = $this->image->getPixelIterator();

    while( $row = $it->getNextIteratorRow() )
	    foreach( $row as $pixel ) $this->colors[] = $pixel->getColor();


Expected result:
Expected different return keys when changing the colorspace constant. Unfortunately i don't know which stack expresses what if the colorspace isn't RGB. Either i don't know if the problem is in quantizeImage() or getColors().


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2007-12-09 12:04 UTC]
Try using the ImagickPixel::getColorAsString() method. You should use that for colorspaces other than RGB(A).
 [2009-02-06 16:34 UTC]
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.

PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Thu Mar 04 12:01:24 2021 UTC