Property | Type | Description | |
---|---|---|---|
$implementation | Jenssegers\ImageHash\Implementation | The hashing implementation. |
Method | Description | |
---|---|---|
__construct ( Jenssegers\ImageHash\Implementation $implementation = null, string $mode = self::HEXADECIMAL ) | Constructor. | |
compare ( mixed $resource1, mixed $resource2 ) : integer | Compare 2 images and get the hamming distance. | |
distance ( integer $hash1, integer $hash2 ) : integer | Calculate the Hamming Distance. | |
hash ( mixed $resource ) : integer | Calculate a perceptual hash of an image file. | |
hashFromString ( mixed $data ) : string | Calculate a perceptual hash of an image string. |
Method | Description | |
---|---|---|
createResource ( string $data ) : resource | Get a GD2 resource from string. | |
destroyResource ( resource $resource ) | Destroy GD2 resource. | |
formatHash ( integer $hash ) : string | integer | Format hash in hex. | |
loadImageResource ( string $file ) : resource | Get a GD2 resource from file. |
public __construct ( Jenssegers\ImageHash\Implementation $implementation = null, string $mode = self::HEXADECIMAL ) | ||
$implementation | Jenssegers\ImageHash\Implementation | |
$mode | string |
protected createResource ( string $data ) : resource | ||
$data | string | |
return | resource |
protected destroyResource ( resource $resource ) | ||
$resource | resource |
public hashFromString ( mixed $data ) : string | ||
$data | mixed | Image data |
return | string |
protected loadImageResource ( string $file ) : resource | ||
$file | string | |
return | resource |