Skip to content
This repository has been archived by the owner on Nov 12, 2021. It is now read-only.

Commit

Permalink
Add width and height for Hash Generation as optional Arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
LordRazen committed Jun 16, 2020
1 parent a4030e0 commit 59d3cf0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/Grafika/Gd/ImageHash/AverageHash.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ class AverageHash
*
* @return string
*/
public function hash($image, $editor)
public function hash($image, $editor, $width = 8, $height = 8)
{
// Resize the image.
$width = 8;
$height = 8;
// $width = 8;
// $height = 8;

$image = clone $image; // Make sure we are working on the clone if Image is passed
$editor->resizeExact($image, $width, $height); // Resize to exactly 8x8
Expand Down
6 changes: 3 additions & 3 deletions src/Grafika/Gd/ImageHash/DifferenceHash.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ class DifferenceHash
*
* @return string
*/
public function hash($image, $editor)
public function hash($image, $editor, $width = 9, $height = 8)
{
$width = 9;
$height = 8;
// $width = 9;
// $height = 8;

$image = clone $image; // Make sure we are working on the clone if Image is passed
$editor->resizeExact($image, $width, $height); // Resize to exactly 9x8
Expand Down

0 comments on commit 59d3cf0

Please sign in to comment.