Hi All,
I have been using the Wideimage (
http://wideimage.sourceforge.net/) library in my gallery extension for the last couple of versions. I have spent some time of the last 2 years the making my own image functions, and experimenting with other libraries, and this is the best I have found.
Essentially it is a small PHP5 library (160KB) that is a wrapper PHP GD functions. GD works well for Joomla extensions, as although ImageMagick has some benefits, it can be difficult to set up and use, especially on shared servers. GD usually works out of the box on any PHP installation.
The library does resizing, cropping, rotating, watermarking (full list is here
http://wideimage.sourceforge.net/documentation/manipulating-images/), and it works well with transparent pngs and gifs.
While making the Joomla 1.6 version of my extension, I have taken wideimage out of the component, and put it into a library plugin. The hope is that it can become a library for 3rd party developers to use and improve, instead of us all using our own image functions inside our extensions.
Currently the plugin is just the wideimage library, with the defined('_JEXEC'), index.html, and support for JFile writing added in.
Immediate goals are to add in JError support and JText language support.
More long term goals are to add in more operations like rounded corners. The library keeps all its operations in separate classes, so to add in a new operation you just drop in the file.
I'm not sure if Joomla needs an image library in the core, as Joomla itself does not do any image manipulation. As it is us 3pd's that do the image manipulation, I think it makes sense to have a library maintained and improved by us.
I also hear the media manager is due for a big upgrade in Joomla 1.7 which may include an image library. I think this is great, but I also think there needs to be a solution for Joomla 1.6 developers now, and the media manager could build on this.
Using the plugin is as easy as:
jimport('joomla.filesystem.file');
if(!jimport('wideimage.WideImage') ){
return JError::raiseWarning(404, 'WideImage Library Not Found');
}
$sourceImage = JPATH_SITE.DS.'images'.DS.'test_image.jpg';
$resizedImage = JPATH_SITE.DS.'images'.DS.'resized_image.jpg';
//resize an image
WideImage::load($sourceImage)->resize(200, 150)->saveToFile($resizedImage);
//resize then crop
WideImage::load($sourceImage)->resize(200, 100)->crop(50, 50, 30, 20)->saveToFile($resizedImage);
//watermark with 50% transparancy
$image = WideImage::load($sourceImage);
$watermark = WideImage::load($source_to_watermark_image);
$image->merge($watermark,"right", "bottom", 50);
More examples and docs are on the wideimage site:
http://wideimage.sourceforge.net/documentation/If others have interest in the project, I can make a Joomlacode project, and google group for development discussion.
[EDIT]Please see
http://www.alltogetherasawhole.org/profiles/blogs/image-library-for... for latest info on this project and a download link[EDIT]
You need to be a member of All Together, As A Whole to add comments!
Join All Together, As A Whole