Пример #1
0
 /**
  * Read image exif data and save if found
  *
  * @throws  Kohana_Exception
  * @return  boolean  true if data found
  */
 public function read()
 {
     // Image required
     $image = $this->image;
     if (!$image->loaded()) {
         throw new Kohana_Exception('Image required for exif data');
     }
     // Read data and save if found
     $file = $image->get_filename('original');
     $exif = Image_Exif::factory($file)->read();
     if (empty($exif)) {
         throw new Kohana_Exception('No exif data found for :file', array(':file' => $file));
     }
     $this->set($exif);
 }
Пример #2
0
Файл: exif.php Проект: anqh/anqh
 /**
  * Read image exif data and save if found
  *
  * @throws  Kohana_Exception
  * @return  boolean  true if data found
  */
 public function read()
 {
     // Image required
     $image = $this->image();
     if (!$image->loaded()) {
         throw new Kohana_Exception('Image required for exif data');
     }
     // Read data and save if found
     $file = $image->get_filename('original');
     $exif = Image_Exif::factory($file)->read();
     if (empty($exif)) {
         return false;
     }
     $this->set_fields($exif);
     return true;
 }