function _exif_get_image_path in Exif 6
From a given node we are going to get the imagepath of the image. if it's an image node it's just going to be images[IMAGE_ORIGINAL]. If it's an imagefield node, we have to go through the fields and look if there is an imagefield and then return the path
Parameters
$fields:
$node:
Return value
unknown_type
2 calls to _exif_get_image_path()
- exif_nodeapi in ./
exif.module - implementation of hook_nodeapi
- fast_gallery_token_values in ./
exif.module - implementation of hook_token_values
File
- ./
exif.module, line 222 - implementing the drupal api
Code
function _exif_get_image_path($fields, &$node) {
if ($node->type == 'image') {
return $node->images[IMAGE_ORIGINAL];
}
foreach ($fields as $field) {
if ($field['type'] == 'filefield') {
$tmp = $node->{$field}['field_name'];
return $tmp[0]['filepath'];
}
}
return NULL;
}