diff --git a/src/main/php/img/io/ExifSegment.class.php b/src/main/php/img/io/ExifSegment.class.php index 75a29f02..58bbdb4f 100755 --- a/src/main/php/img/io/ExifSegment.class.php +++ b/src/main/php/img/io/ExifSegment.class.php @@ -1,7 +1,7 @@ 'Sharpness', 0xA40B => 'DeviceSettingDescription', 0xA40C => 'SubjectDistanceRange', - 0xA420 => 'ImageUniqueID' + 0xA420 => 'ImageUniqueID', + 0xA434 => 'LensModel', ]; /** @@ -583,7 +584,7 @@ public function rawData($arg= null) { * @return string */ public function toString() { - return nameof($this).'<'.$this->marker.'>'.\xp::stringOf($this->data); + return nameof($this).'<'.$this->marker.'>'.Objects::stringOf($this->data); } /** diff --git a/src/main/php/img/io/ImageMetaData.class.php b/src/main/php/img/io/ImageMetaData.class.php index c9af9ee7..3c5e4ece 100755 --- a/src/main/php/img/io/ImageMetaData.class.php +++ b/src/main/php/img/io/ImageMetaData.class.php @@ -164,6 +164,7 @@ public function exifData($tz= null) { $data->withSoftware(null === ($l= self::lookup($raw, 'Software')) ? null : trim($l)); $exif= $raw['Exif_IFD_Pointer']['data']; + $data->withLensModel(null === ($l= self::lookup($exif, 'LensModel')) ? null : trim($l)); if ($sof= $this->segmentsOf(SOFNSegment::class)) { $data->withWidth($sof[0]->width()); @@ -212,7 +213,8 @@ public function exifData($tz= null) { $data->withFlash(self::lookup($exif, 'Flash')); if (null !== ($date= self::lookup($exif, 'DateTimeOriginal', 'DateTimeDigitized', 'DateTime'))) { - $data->withDateTime(new Date($date, $tz)); + sscanf($date, '%d:%d:%d %d:%d:%d', $year, $month, $day, $hour, $minute, $second); + $data->withDateTime(Date::create($year, $month, $day, $hour, $minute, $second, $tz)); } if (null !== ($o= self::lookup($exif, 'Orientation'))) { diff --git a/src/main/php/img/util/ExifData.class.php b/src/main/php/img/util/ExifData.class.php index 1c16b488..7003d53c 100755 --- a/src/main/php/img/util/ExifData.class.php +++ b/src/main/php/img/util/ExifData.class.php @@ -16,6 +16,7 @@ class ExifData implements Value { $width = 0, $make = '', $model = '', + $lensModel = '', $flash = 0, $orientation = 0, $fileName = '', @@ -79,6 +80,17 @@ public function withModel($model) { return $this; } + /** + * Set Lens Model + * + * @param string model + * @return self + */ + public function withLensModel($lensModel) { + $this->lensModel= $lensModel; + return $this; + } + /** * Set Flash * @@ -375,6 +387,7 @@ public function toString() { " [file ] %s (%d bytes)\n". " [make ] %s\n". " [model ] %s\n". + " [lensModel ] %s\n". " [software ] %s\n". " [flash ] %d (%s)\n". " [orientation ] %s (%s, %s)\n". @@ -395,6 +408,7 @@ public function toString() { $this->fileSize, $this->make, $this->model, + $this->lensModel, $this->software, $this->flash, $this->flashUsed() ? 'on' : 'off',