[drupal-devel] New image.module

John Layt john at layt.net
Mon Feb 21 09:56:37 UTC 2005


On Mon, 21 Feb 2005 09:07, Stefan Nagtegaal wrote:
> James Walker schreef:
> > As promised, I've just committed brand new versions of "my"
> > image.module to my sandbox. A working version for CVS HEAD is at :
> > contributions/sandbox/walkah/image (compatible with the new "image
> > api"). There is also a 4.5 version available in the "45" subdirectory.
>
> I know, and it rocks! But, after some serious testing I have only 3
> little things which are missing:
> - in image.inc you use ImageCreateTrueColor() which is only present in
> GD 2.0.. If the function is not resent there is no error message; it
> just breaks the it.. Please let it fall back the function
> _ImageCopyResampled() which is somewhere in the Attc of Marco Molinari's
> Sandbox
> (http://cvs.drupal.org/viewcvs/drupal/contributions/sandbox/marco/fileapi/)
>. - There is a *.po missing for the image.module;
> - How can we manipulate the way thumbnails and photo's are created? How
> can i override the standard thumbnail/photo ideas? What if I want to
> make transparent PNG's of my photographs which are randomly rotated?
> (Like here: http://frontaal-online.com/fotoalbum/oude-doos)
>   It would be a very nice feature to have!
>
> And, that's all! You did a great job on this and I can't thank you
> enough for this "gift from heaven"...
> It works like a charm!
>
>
> Yours sincerely,
>
> Stefan.

I haven't had the chance to look at the new module yet, so I don't know how it 
compares, but I had been messing around with writing my own version to suit 
my own needs for a while (and as a means to learn php/drupal) until I heard 
about James' efforts and put it on hold.

My version does include some of the things you mention, such as supporting 
both GD1 and GD2 (among others), autodetecting which libraries are available, 
setting background colour for rotation (but I think this was in the old 
module?), different thumbnail policies, and different image scaling policies 
(these last two currently only at a site or module level, but I intended to 
extend it to the individual image or node level and the api allows for it).  

You can find the code at http://www.layt.net/john/projects/graphic, feel free 
to borrow any code you might like the look of.  I'll have a look at James' 
work next weekend to see if it meets my needs (or if I need to borrow his 
upload code for mine :-).

Cheers!

John. 

P.S. Loved the photos on your site, reminded me of my old marching band 
days :-)




More information about the drupal-devel mailing list