return $view;
}
+ /**
+ * Get the image attributes from the backend.
+ *
+ * @param Ansel_Image $image The image to retrieve attributes for.
+ * attributes for.
+ * @param boolean $format Format the EXIF data. If false, the raw data
+ * is returned.
+ *
+ * @return array The EXIF data.
+ * @static
+ */
+ function getAttributes($format = false)
+ {
+ $attributes = $GLOBALS['ansel_storage']->getImageAttributes($this->id);
+ $fields = Horde_Image_Exif::getFields();
+ $output = array();
+
+ foreach ($fields as $field => $data) {
+ if (!isset($attributes[$field])) {
+ continue;
+ }
+ $value = Horde_Image_Exif::getHumanReadable($field, Horde_String::convertCharset($attributes[$field], $GLOBALS['conf']['sql']['charset']));
+ if (!$format) {
+ $output[$field] = $value;
+ } else {
+ $description = isset($data['description']) ? $data['description'] : $field;
+ $output[] = '<td><strong>' . $description . '</strong></td><td>' . htmlspecialchars($value, ENT_COMPAT, Horde_Nls::getCharset()) . '</td>';
+ }
+ }
+
+ return $output;
+ }
+
}
/**
}
/**
+ * Get image attribtues from ansel_image_attributes table
+ *
+ * @param $image_id
+ * @return unknown_type
+ */
+ function getImageAttributes($image_id)
+ {
+ return $GLOBALS['ansel_db']->queryAll('SELECT attr_name, attr_value FROM ansel_image_attributes WHERE image_id = ' . (int)$image_id, null, MDB2_FETCHMODE_ASSOC, true);
+ }
+
+ /**
* Like getRecentImages, but returns geotag data for the most recently added
* images from the current user. Useful for providing images to help locate
* images at the same place.