PHP: php-imagick: Thumbnail from thispersondoesnotexists

PHOTO EMBED

Mon Aug 29 2022 18:49:22 GMT+0000 (Coordinated Universal Time)

Saved by @marcopinero #php

<?php
function Thumbnail($url, $width = 64, $height = 64) {

    // download and create gd image
    $image = file_get_contents($url);
    $img = new Imagick();
    $img->readImageBlob($image);
    $img->scaleImage($width,$height);
   
    echo $img->getImageBlob();
}

header("content-type: image/jpeg");
Thumbnail("https://thispersondoesnotexist.com/image#.jpg", 64, 64);

?>
content_copyCOPY