This is the command:
Code: Select all
/usr/local/bin/convert "{$filepath}" -size 1x14 xc:Black -background Black -append -gravity South -fill White -draw "text 0,0 '{$filereso['0']}x{$filereso['1']} - {$filesize}" "{$outputpath}";
Code: Select all
/usr/local/bin/convert "{$filepath}" -size 1x14 xc:Black -background Black -append -gravity South -fill White -draw "text 0,0 '{$filereso['0']}x{$filereso['1']} - {$filesize}" "{$outputpath}";
Code: Select all
<?php
$imagick = new Imagick();
$canvas = new Imagick();
$canvasdraw = new ImagickDraw();
$imagick->readImage("shin_chan.jpg");
$imagick->thumbnailImage(160, 0);
$imagick->setImageFormat("jpeg");
$canvas->newImage($imagick->getImageWidth(), ($imagick->getImageHeight() + 14), new ImagickPixel("black"));
$canvas->setImageFormat("jpeg");
$canvasdraw->setFillColor(new ImagickPixel("white"));
$canvasdraw->setFontSize(11);
$canvasdraw->setFontWeight(600);
$canvasdraw->setGravity(imagick::GRAVITY_SOUTH);
$canvas->annotateImage($canvasdraw, 0, 0, 0, "1000x1000 - 16kb");
$canvas->compositeImage($imagick, imagick::COMPOSITE_OVER, 0, 0);
$canvas->setImageCompression(9);
header("Content-Type: image/jpeg");
echo $canvas->getImageBlob();
?>