php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #69797 Add phash metric for Imagick::compareImages
Submitted: 2015-06-11 12:08 UTC Modified: 2015-06-16 11:47 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: ch1902a at gmail dot com Assigned: danack (profile)
Status: Closed Package: imagick (PECL)
PHP Version: 5.6.9 OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: ch1902a at gmail dot com
New email:
PHP Version: OS:

 

 [2015-06-11 12:08 UTC] ch1902a at gmail dot com
Description:
------------
ImageMagick 6.8.8.3 supports a perceptual hash metric for comparing images: http://www.imagemagick.org/discourse-server/viewtopic.php?t=24906 but there is no Imagick::METRIC_PHASH constant in PHP so I'm guessing it's not currently supported. Could you please add support for the perceptual hash metric to Imagick::compareImages() and any other missing metrics given by compare -list metric.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-06-13 21:51 UTC] danack@php.net
-Assigned To: +Assigned To: danack
 [2015-06-13 21:56 UTC] danack@php.net
I'll add it to the next version.

Because the constants are just numbers, which Imagick doesn't check before passing onto ImageMagick, you should be able to use it by just setting the appropriate value.

Which should be 9 as it's the 10th element (zero based counting) of the enum here:

https://github.com/ImageMagick/ImageMagick/blob/7922e0cc8b7e19b7d010161cdb6f7b12b9a05375/MagickCore/compare.h#L38
 [2015-06-16 11:47 UTC] danack@php.net
-Status: Assigned +Status: Closed
 [2015-06-16 11:47 UTC] danack@php.net
It has been added and is available in master, and will be in the next release:
https://github.com/mkoppanen/imagick/blob/master/imagick_helpers.c#L1085
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue May 07 06:01:30 2024 UTC