The Rise of Contactless Payments:...
In recent years, contactless payments have surged in popularity, driven...
<?php
namespace Intervention\Image\Imagick;
use Intervention\Image\AbstractDriver;
use Intervention\Image\Exception\NotSupportedException;
use Intervention\Image\Image;
class Driver extends AbstractDriver
{
/**
* Creates new instance of driver
*
* @param Decoder $decoder
* @param Encoder $encoder
*/
public function __construct(Decoder $decoder = null, Encoder $encoder = null)
{
if ( ! $this->coreAvailable()) {
throw new NotSupportedException(
"ImageMagick module not available with this PHP installation."
);
}
$this->decoder = $decoder ? $decoder : new Decoder;
$this->encoder = $encoder ? $encoder : new Encoder;
}
/**
* Creates new image instance
*
* @param int $width
* @param int $height
* @param mixed $background
* @return \Intervention\Image\Image
*/
public function newImage($width, $height, $background = null)
{
$background = new Color($background);
// create empty core
$core = new \Imagick;
$core->newImage($width, $height, $background->getPixel(), 'png');
$core->setType(\Imagick::IMGTYPE_UNDEFINED);
$core->setImageType(\Imagick::IMGTYPE_UNDEFINED);
$core->setColorspace(\Imagick::COLORSPACE_UNDEFINED);
// build image
$image = new Image(new static, $core);
return $image;
}
/**
* Reads given string into color object
*
* @param string $value
* @return AbstractColor
*/
public function parseColor($value)
{
return new Color($value);
}
/**
* Checks if core module installation is available
*
* @return boolean
*/
protected function coreAvailable()
{
return (extension_loaded('imagick') && class_exists('Imagick'));
}
}
Blog Section
Dive into our blog to explore the cutting-edge trends in digital payments and NFC technology. Stay updated on the innovations that are revolutionizing transactions, boosting security, and making payments quicker and more convenient. Learn how these advancements are shaping the future of financial interactions and driving the global transition towards a cashless world.
In recent years, contactless payments have surged in popularity, driven...
As digital transactions proliferate, ensuring robust payment security is more critical than ever. Two foundational...
Digital wallets have fundamentally transformed how we manage money, offering a streamlined, secure, and highly...