You are here

function image_load in Image 6

Same name and namespace in other branches
  1. 5.2 image.module \image_load()
  2. 5 image.module \image_load()

Implementation of hook_load().

1 call to image_load()
image_handler_field_image_node_image::render_html in views/image_handler_field_image_node_image.inc
Return image html, using image_load() and image_display().

File

./image.module, line 466

Code

function image_load(&$node) {
  $result = db_query("SELECT i.image_size, f.filepath FROM {image} i INNER JOIN {files} f ON i.fid = f.fid WHERE i.nid = %d", $node->nid);
  $node->images = array();
  while ($file = db_fetch_object($result)) {
    $node->images[$file->image_size] = file_create_path($file->filepath);
  }
  $original_path = isset($node->images[IMAGE_ORIGINAL]) ? $node->images[IMAGE_ORIGINAL] : NULL;
  if (empty($original_path)) {

    // There's no original image, we're in trouble...
    return;
  }
  if (arg(0) != 'batch' && strpos($_GET['q'], 'admin/content/node') === FALSE) {
    _image_build_derivatives_if_needed($node);
  }
}