-
-
Save luancmaia/6c67cafdef110b0b9149d15a5083ff7b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$image = new Imagick(); | |
$image->newImage(1100, 460, new ImagickPixel('red')); | |
$image->setImageFormat("jpg"); | |
$type=$image->getFormat(); | |
header("Content-type: $type"); | |
$iw = $image->getimagewidth(); | |
$ih = $image->getimageheight(); | |
$inw = $iw / $ih * 460; | |
$texture = new Imagick(); | |
$texture->readImage($pathToImage); | |
$texture->scaleImage($inw, 460); | |
$image = $image->textureImage($texture); | |
echo $image; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment