1. Go to this page and download the library: Download php-quickorm/image-resize library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
php-quickorm / image-resize example snippets
// Resize the firework.jpg to 800x600
$a = new ImageResize(realpath('firework.jpg'),800,600);
// Save to firework2.png;
$a->save("firework.png");
// or send as HTTP response
$a->render();
// Resize the firework.jpg to 800x600
$a = new ImageResize(realpath('firework.jpg'),800,600);
/*
* Add text to image
* The font size is 1 - 5 and the position only supports bottom-left, bottom-right, top-left, top-right
*/
// use font size 5, color #ffffff and place at bottom-right with margin 10px
$a->addTextMark("Author:Rytia", 5, "#ffffff", "right", "bottom",10);
// use font size 4, color #ccccc and place at bottom-left with margin 15px
$a->addTextMark("Blog:www.zzfly.net", 4, "#cccccc", "left", "bottom",15);
/*
* Add water mark to image
* The position only supports bottom-left, bottom-right, top-left, top-right
*/
$a->addImageMark(realpath('mark.jpg'),100,80,"right","bottom",50);
// Save to firework2.png;
$a->save("firework.png");
// or send as HTTP response
$a->render();
composer
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.