php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #58730 modulateImage() arguments is not correct
Submitted: 2009-06-18 15:10 UTC Modified: 2010-02-28 07:11 UTC
From: pelle at pelleravn dot dk Assigned:
Status: No Feedback Package: imagick (PECL)
PHP Version: 5.2.9 OS: Linux Ubuntu Srv 7.10 (2.6.27)
Private report: No CVE-ID: None
 [2009-06-18 15:10 UTC] pelle at pelleravn dot dk
Description:
------------
The documentation for modulateImage is like this:

bool Imagick::modulateImage ( float $brightness , float 
$saturation , float $hue )

The "Code 1" source should get the image grayscale because of 
the saturation (argument 2) gets zero. But nothing happens at 
all.

The "Code 2" source makes the image grayscale (as the "Code 1" 
should have done). That should be the hue (argument 3) and 
made the image colors crazy.

Reproduce code:
---------------
/* Code 1: */
$this->im = new Imagick();
$this->im->readImage($this->dir . $this->file);
$this->im->modulateImage(100, 0, 100);

/* Code 2 */
$this->im = new Imagick();
$this->im->readImage($this->dir . $this->file);
$this->im->modulateImage(100, 100, 0);

Expected result:
----------------
The image should get grayscale if saturation (argument 2) is 0

Actual result:
--------------
Nothing happens.
But if changing the hue, the result is "correct".

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-06-18 15:53 UTC] mkoppanen@php.net
If I remember correctly the values range from 0.0 to 1.0. Can you test?
 [2009-06-18 16:29 UTC] pelle at pelleravn dot dk
Argument 1: (Only if argument 2 and 3 are 100)
===========
0.5 = all black
1 = all black
50 = a little dark
100 = original

Argument 2: (Only if argument 1 and 3 are 100)
===========
0.9 = all gray
1 = original colors
50 = original colors
100 = original colors

Argument 3: (Onlu if argument 1 and 2 are 100)
===========
0.9 = all gray
1 = all gray
50 = colors faded
100 = original colors

A comment in the documentation at php.net 
(http://www.php.net/manual/en/function.imagick-
modulateimage.php) said that it should be 100. That's also 
what me test cases showed was right.

But you are right at some point, that argument 2 were gray 
if it was under 1 (e.g 0.9), but it doesn't change at all 
even if it's 0.1 or 0.9, and 1 gives original colors back.
 [2009-08-24 16:11 UTC] mkoppanen@php.net
Hello,

I checked the parameters and they should be percentage of change. The range therefore is -100 to +100. Does that give correct results?
 [2010-02-28 07:11 UTC] mkoppanen@php.net
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-2024 The PHP Group
All rights reserved.
Last updated: Tue Oct 15 12:01:27 2024 UTC