note 109641 added to ref.image
| From: | clemsybarite at laposte dot net | Date: | Fri, 03 Aug 2012 22:10:01 +0000 |
| Subject: | note 109641 added to ref.image | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-189914@lists.php.net to get a copy of this message | ||
Here a powerfull open-source class based on the GD library to work easily with your images: http://phpimageworkshop.com/. Also available on github: http://github.com/Sybio/ImageWorkshop
An example, a simple resize on a physical image file on the server:
<?php
// Initializing a layer based on picture.jpg
$layer = new ImageWorkshop(array(
"imageFromPath" => "/path/to/images/picture.jpg",
));
// Resize the layer (and so the picture in background)
$thumbWidth = 200;
$thumbHeight = 100;
$conserveProportion = true;
$layer->resizeInPixel($thumbWidth, $thumbHeight, $conserveProportion);
// Saving the resulting image
$dirPath = __DIR__."/../../../../../../web/uploads/2012";
$filename = "picture-thumb.png";
$createFolders = true;
$backgroundColor = null; // transparent, only for PNG (otherwise it will be white if set null)
$imageQuality = 95; // useless for GIF, usefull for PNG and JPEG (0 to 100%)
$layer->save($dirPath, $filename, $createFolders, $backgroundColor, $imageQuality);
?>
----
Server IP: 69.147.83.197
Probable Submitter: 83.194.162.175
----
Manual Page -- http://www.php.net/manual/en/ref.image.php
Edit -- https://master.php.net/note/edit/109641
Del: integrated -- https://master.php.net/note/delete/109641/integrated
Del: useless -- https://master.php.net/note/delete/109641/useless
Del: bad code -- https://master.php.net/note/delete/109641/bad+code
Del: spam -- https://master.php.net/note/delete/109641/spam
Del: non-english -- https://master.php.net/note/delete/109641/non-english
Del: in docs -- https://master.php.net/note/delete/109641/in+docs
Del: other reasons-- https://master.php.net/note/delete/109641
Reject -- https://master.php.net/note/reject/109641
Search -- https://master.php.net/manage/user-notes.php