If we would have a function call that would cache any image that would be great. For example:
get_image_cache("<img src="http://animage_remote.com" />
This would be great, because we could use the module anywhere, in blocks, contemplate not just nodes.
Comments
Comment #1
eastcn commentedSet of hooks, may be a good idea, I need to think about it.
e.g: module_invoke_all('get_image_validate', $node, $file) or module_invoke_all('get_image_save', $node, $file)
Comment #2
giorgio79 commentedA module_invoke_all sounds good but as per the Drupal API docs it is used for
"Invoke a hook in all enabled modules that implement it."
I think it should be the other way, around. A hook that can be called by other modules, sg as simple as
get_image_cache($file);
inside this one call we could have the validate and save functions perform the actions. This way it would be super simple to implement with other modules, or just simply in a php enabled block etc etc.