From bf9a6737bee0c8ddc35d878c20efa35386551733 Mon Sep 17 00:00:00 2001 From: Timm Friebe Date: Sun, 22 Dec 2024 18:04:17 +0100 Subject: [PATCH] Read lens model and pass it to EXIF data --- src/main/php/img/io/ExifSegment.class.php | 7 ++++--- src/main/php/img/util/ExifData.class.php | 14 ++++++++++++++ 2 files changed, 18 insertions(+), 3 deletions(-) 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/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',