|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2010-09-09 00:20 UTC] matvey at copters dot ru
Description:
------------
$this->insecure = new Imagick("file.tiff");
$this->originalhash = hash('md5', $this->insecure->getimageblob());
$this->originalhash is always different, but file.tiff is always the same.
Test script:
---------------
$ob = new Imagick("file.tiff");
$hash = hash('md5', $ob->getimageblob());
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 12:00:01 2025 UTC |
rgp@cp ~/src $ cat s.php <?php $s = array( 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, ); foreach ($s as $t) { $ob = new Imagick("test.tif"); $hash = hash('md5', $ob->getimageblob()); echo "{$hash} \n"; } ?> rgp@cp ~/src $ php -f s.php 3a0eff2dc635064f91f9720e4f02fc25 0e15adc163724345c26305df4cb2faed 0e15adc163724345c26305df4cb2faed a6577644313c4fbd5014028c16a78e84 dd391a6977cc7a6af56037959d607c90 dd391a6977cc7a6af56037959d607c90 83caff49e5d8abe704cf8c298770314f e85136bd4259b4b18e8f0bbc9867da9b 36bdf4fc1806f83040b71a7214cc1d4c 491f7bc84db9b83602f9d5ebc13f530aOk, but why on earth the same file.tiff hash_file('md5', 'file.tiff'); produces constant values? Thanx for the tip.rgp@cp ~/src $ cat f.php <?php $s = array( 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, ); foreach ($s as $t) { $hash = hash_file('md5', "test.tif"); echo "{$hash} \n"; } ?> rgp@cp ~/src $ php -f f.php be42c81505f2c9ef70994c60915a3f12 be42c81505f2c9ef70994c60915a3f12 be42c81505f2c9ef70994c60915a3f12 be42c81505f2c9ef70994c60915a3f12 be42c81505f2c9ef70994c60915a3f12 be42c81505f2c9ef70994c60915a3f12 be42c81505f2c9ef70994c60915a3f12 be42c81505f2c9ef70994c60915a3f12 be42c81505f2c9ef70994c60915a3f12 be42c81505f2c9ef70994c60915a3f12