NEW Imgecache service : Triggering the creation of imagecache derivatives programmatically

Events happening in the community are now at Drupal community events on www.drupal.org.
Posted by carlosg2 on April 12, 2009 at 7:20am

Hello all,

This service force the creation of an image derivative with imagecache. Just pass the relative url of the image and the name of image cache preset.

The title and code is from Florian Lorétan. Read more from his blog:
http://happypixels.net/blog/triggering-creation-imagecache-derivatives-p...

It was so easy to make a service.
But what im looking for is to create presets on the fly, something like:

Scale (width=160, height=null , upscale: false)
Crop (width= 155, height= 160, xoffset= center, yoffset= center)
Sharpen ( radius= 0.5, sigma= 0.5, amount= 100, threshold= 0.05)
And so on...

Any body know how this can be accomplish?

Download link
http://www.prismacore.com/lab/drupal/imagecache_service.rar
Please test this module and keep in mind that is my fist one.

Regards.
Carlos Garza

Comments

wow, thanks a bunch for that

Posted by imp7 on March 15, 2010 at 1:45am

wow, thanks a bunch for that function, works like a charm :)
I take it imagecache_build_derivative tells imagecache to create the image if cron hasn't run or something?

Is there any chance you could

Posted by gdd on March 15, 2010 at 2:05am

Is there any chance you could work this into a patch for the Imagecache module? It would be great to get it included for them.

@Heyrocker: For at least

Posted by voxpelli on March 15, 2010 at 8:01am

@Heyrocker: For at least 7.x-3.x it should be considered if something like this should be included in Services Core since the Imagecache-module will be included in Drupal 7 core?

An alternative solution to including it in Imagecache Core might also be to release this as its own module which could be made to work with both D6 and D7.

Great

Posted by carlosg2 on March 15, 2010 at 8:13pm

@imp7: Sorry i didn't understand your question.

@heyrocker @voxpelli
Im asking for service support here:
http://drupal.org/node/743248

I would prefer its own module

Posted by imp7 on March 15, 2010 at 11:40pm

I would prefer its own module as 6.x will be around for a while yet. Its pretty cool imagecache will be in core though.

@carlosg2 I was just trying to understand how imagecache works. From what I understand the images are usually generated and triggered by an HTTP request and thats what the imagecache_build_derivative is doing by itself.

Services

Group organizers

Group categories

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

AltStyle によって変換されたページ (->オリジナル) /