Image wrapper extension

From: Date: Thu, 03 Jan 2002 08:22:40 +0000
Subject: Image wrapper extension
Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-3754@lists.php.net to get a copy of this message
Hi, Following on from the discussion about image classes, I knocked up a quick wrapper for the GD and ImageMagick extensions that could easily be adapted to other extensions. Basically I'm posting this message not because the code is ready to be used, but because it's my first attempt at using the PEAR coding standards, and I'd like someone to check that I'm using them corectly :-) Class code is at: <http://www.mapledesign.co.uk/coding/ImageGD.phps> <http://www.mapledesign.co.uk/coding/ImageIM.phps> Eventually I'd like the classes to be called in the same way as the PEAR-DB - one class is instituted $im = new Image('GD'); and includes/initialises the correct extension-specific class. This is a sample useage of the current class (eg when you have to include the correct one) <?php require_once 'ImageGD.php'; $im = new Image; $im->load('Foobar.jpg'); $im->resize('600', '480'); $im->display(); // next will resize so that the largest length is 300px - height or width $im->scale(300); $im->save(THUMBNAIL_DIR . 'Foobar.jpg'); // Now free the memory - should be called free? $im->destroy(); ?> Currently, every time you save/display an image in ImageGD, the image file gets reset to the original. My question is: would you want this behaviour? I wrote it this way because I need to make 3 thumbnails from the same image, and working from the original image would (I think) give me better quality thumbnails. I still haven't figured out how to get this behaviour in ImageIM, because the functions work differently AFAIK. Feedback much appreciated! Peter. ---oOo--- sendcard - *The* PHP e-card solution - as used by Excite! http://www.sendcard.f2s.com/ ---oOo---

« previous php.pear.dev (#3754) next »