note 111776 added to imagick.getimagesignature
| From: | vojtech at kral dot hk | Date: | Wed, 27 Mar 2013 12:39:08 +0000 |
| Subject: | note 111776 added to imagick.getimagesignature | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-194231@lists.php.net to get a copy of this message | ||
Well the SHA-2 digest returned by this function IS different from what you get when you hash the
file, because this funtions hashesh the pixels themselves.
This is very useful when you need to identify identical images, because if you just hash the files,
you may get different hashes even if the image is the same pixel by pixel because of differences in
metadata or different format (ie PNG vs BMP) or perhaps stray bytes at the end of file etc...
There is no point in posting code that hashes files, that is completely irrelevant here.
Also, I doubt you really need to pick a different hashing algo, SHA-2 should be perfectly fine for
this job.
----
Server IP: 69.147.83.199
Probable Submitter: 147.32.84.59
----
Manual Page -- http://php.net/manual/en/imagick.getimagesignature.php
Edit -- https://master.php.net/note/edit/111776
Del: integrated -- https://master.php.net/note/delete/111776/integrated
Del: useless -- https://master.php.net/note/delete/111776/useless
Del: bad code -- https://master.php.net/note/delete/111776/bad+code
Del: spam -- https://master.php.net/note/delete/111776/spam
Del: non-english -- https://master.php.net/note/delete/111776/non-english
Del: in docs -- https://master.php.net/note/delete/111776/in+docs
Del: other reasons-- https://master.php.net/note/delete/111776
Reject -- https://master.php.net/note/reject/111776
Search -- https://master.php.net/manage/user-notes.php