Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions src/Markers.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,19 @@ class Markers
*/
private $coordinates = [];

public function __construct($pathImage)
/**
* Markers constructor.
*
* @param string|Image $image Path to the image or an instance of Image
*/
public function __construct($image)
{
$this->image = Image::fromPath($pathImage);
// If the pathImage is already an instance of Image, we use it directly
if ($image instanceof Image) {
$this->image = $image;
} else {
$this->image = Image::fromPath($image);
}
}

/**
Expand Down