[development] Processing an image when a node is saved (D7)

Steve Yelvington steve at yelvington.com
Sun Feb 6 02:30:33 UTC 2011


Sorry, T-bird fired before ready. As I was saying: Krumo shows:

    *
      filename(/String,*12 characters*/)*P1000038.JPG*
    *
      uri(/String,*33 characters*/)*public://field/image/P1000038.JPG*


... but I really need this to work when the node is being created OR 
updated. What hook should I be implementing instead?



On 02/05/2011 09:24 PM, Steve Yelvington wrote:
> I have a content type with an image field. I want to pull some 
> metadata from the image file when the node is created or updated.  I 
> thought this would be pretty straightforward, but I'm baffled by some 
> things that are going on in D7.
>
> I thought I'd implement hook_node_presave(). Apparently the image file 
> isn't properly known by $node at that point. Krumo shows 
> field_image['und'][0] but none of its child elements have useful 
> information. And I have no idea what 'und' is all about.
>
> I added node_load() to see if that would help. On an existing node, it 
> makes a difference. Krumo shows:
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/development/attachments/20110205/b3820a57/attachment.html 


More information about the development mailing list