Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1057023
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T17:48:09+00:00 2026-05-16T17:48:09+00:00

A bit of a followup from a previous question . As I mentioned in

  • 0

A bit of a followup from a previous question.

As I mentioned in that question, my overall goal is to call a Ruby script after ImageCache does its magic with generating thumbnails and whatnot.

Sebi’s suggestion from this question involved using hook_nodeapi.
Sadly, my Drupal knowledge of creating modules and/or hacking into existing modules is pretty limited.

So, for this question:

  1. Should I create my own module or attempt to modify the ImageCache module?
  2. How do I go about getting the generated thumbnail path (from ImageCache) to pass into my Ruby script?

edit

I found this question searching through SO…
Is it possible to do something similar in the _imagecache_cache function that would do what I want?

ie

function _imagecache_cache($presetname, $path) {
  ...
  ...
  // check if deriv exists... (file was created between apaches request handler and reaching this code)
  // otherwise try to create the derivative.
  if (file_exists($dst) || imagecache_build_derivative($preset['actions'], $src, $dst)) {
    imagecache_transfer($dst);

    // call ruby script here
    call('MY RUBY SCRIPT');
  }
  • 1 1 Answer
  • 3 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T17:48:10+00:00Added an answer on May 16, 2026 at 5:48 pm
    1. Don’t hack into imagecache, remember every time you hack core/contrib modules god kills a kitten 😉

    2. You should create a module that invokes hook_nodeapi, look at the api documentation to find the correct entry point for your script, nodeapi works on various different levels of the node process so you have to pick the correct one for you (it should become clear when you check the link out) http://api.drupal.org/api/function/hook_nodeapi

    You won’t be able to call the function you’ve shown because it is private so you’ll have to find another route.

    You could try and build the path up manually, you should be able to pull out the filename of the uploaded file and then append it to the directory structure, ugly but it should work. e.g.

    If the uploaded file is called test123.jpg then it should be in /files/imagecache/thumbnails/test123/jpg (or something similar).

    Hope it helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is a bit of a follow-up from a previous question on improving rails
As a bit of a followup question to my previous , I need to
Bit support question. Apologies for that. I have an application linked with GNU readline.
Bit of a bizarre question, but does anyone know the actual limit to the
(This is a follow-up from this previous question ). I was able to successfully
This Question arises from a Q&A here I have some doubts that i think
This is a follow up question from a previous SO question . Now I
This is a bit of a followup to my last question: Canvas is drawing
this is a followup to my previous question , whereby I'm writing a PHP
Bit of an unusual question, but I have setup a field inside a MySQL

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.