public function loadBinaryString($data)
{
$this->resource = new Gmagick();
try {
$this->resource->readImageBlob($data);
} catch (\GmagickException $e) {
throw new \InvalidArgumentException("Passed binary string is empty or is not a valid image", 0, $e);
}
}