/** * @param string $file * * @return Exif */ protected static function readExif($file) { if (static::$exifReader === null) { static::$exifReader = Reader::factory(Reader::TYPE_NATIVE); } try { $exif = static::$exifReader->read($file); return Exif::cast($exif); } catch (\RuntimeException $e) { return new Exif(); } }
public function testCast() { $exif = new Exif([]); $this->assertInstanceOf('Bolt\\Filesystem\\Handler\\Image\\Exif', $exif->cast(new PHPExif\Exif([]))); }