diff --git a/composer.json b/composer.json index e1a17af..84e83a1 100755 --- a/composer.json +++ b/composer.json @@ -5,7 +5,7 @@ "require": { "xp-framework/compiler": "^9.3", - "xp-framework/imaging": "^11.0", + "xp-framework/imaging": "^11.1", "xp-framework/command": "^12.0", "xp-framework/networking": "^10.4", "xp-forge/marshalling": "^2.4", diff --git a/src/main/handlebars/layout.handlebars b/src/main/handlebars/layout.handlebars index a113bf5..d5976eb 100755 --- a/src/main/handlebars/layout.handlebars +++ b/src/main/handlebars/layout.handlebars @@ -680,7 +680,7 @@ left: 0; font-size: .9rem; display: grid; - grid-template-columns: repeat(6, max-content); + grid-template-columns: repeat(8, max-content); gap: 1px; justify-content: center; pointer-events: none; @@ -747,7 +747,7 @@ max-width: 100%; .meta { - grid-template-columns: repeat(3, max-content) 1fr; + grid-template-columns: repeat(4, 1fr); transform: scale(1, 1); gap: 0; background-color: white; @@ -761,8 +761,12 @@ border-radius: 0; } - .meta div:nth-child(2) { - grid-column: span 3; + .meta div:nth-child(1) { + grid-column: span 2; + } + + .meta div:nth-child(4) { + grid-column: span 4; } .meta div { @@ -811,8 +815,10 @@
Lightbox
+
+
ISO
mm
diff --git a/src/main/php/de/thekid/dialog/processing/Images.php b/src/main/php/de/thekid/dialog/processing/Images.php index 84449d8..6643438 100755 --- a/src/main/php/de/thekid/dialog/processing/Images.php +++ b/src/main/php/de/thekid/dialog/processing/Images.php @@ -1,9 +1,10 @@ { $r+= [ 'width' => $exif->width, 'height' => $exif->height, - 'dateTime' => $exif->dateTime?->toString('c', self::$UTC) ?? gmdate('c'), + 'dateTime' => $exif->dateTime?->toString(self::DATEFORMAT), 'make' => $exif->make, 'model' => $exif->model, + 'lensModel' => $exif->lensModel, 'apertureFNumber' => $exif->apertureFNumber, 'exposureTime' => $exif->exposureTime, 'isoSpeedRatings' => $exif->isoSpeedRatings, @@ -34,6 +36,13 @@ public function meta(File $source): array { 'flashUsed' => $exif->flashUsed(), ]; } + + // Merge in XMP segment + if ($xmp= $meta?->segmentsOf(XMPSegment::class)) { + foreach ($xmp[0]->document()->getElementsByTagNameNS(self::RDF, 'Description')[0]->attributes as $attr) { + $r[lcfirst($attr->name)]= $attr->value; + } + } return $r; } finally { $source->close(); diff --git a/src/main/php/de/thekid/dialog/processing/Processing.php b/src/main/php/de/thekid/dialog/processing/Processing.php index 7eb63e4..0a95055 100755 --- a/src/main/php/de/thekid/dialog/processing/Processing.php +++ b/src/main/php/de/thekid/dialog/processing/Processing.php @@ -4,7 +4,7 @@ use util\TimeZone; abstract class Processing { - protected static $UTC= new TimeZone('UTC'); + protected const DATEFORMAT= 'd.m.Y H:i'; protected $targets= []; /** Returns processing kind */ diff --git a/src/main/php/de/thekid/dialog/processing/Videos.php b/src/main/php/de/thekid/dialog/processing/Videos.php index c39442b..5eea61b 100755 --- a/src/main/php/de/thekid/dialog/processing/Videos.php +++ b/src/main/php/de/thekid/dialog/processing/Videos.php @@ -27,7 +27,7 @@ private function execute(string $command, array $args): void { } public function meta(File $source): array { - static $MAP= [ + static $mdta= [ 'mdta:com.apple.quicktime.make' => 'make', 'mdta:com.apple.quicktime.model' => 'model', 'mdta:com.android.manufacturer' => 'make', @@ -49,21 +49,21 @@ public function meta(File $source): array { // Normalize meta data from iOS and Android devices $r= []; foreach ($meta as $key => $value) { - if ($mapped= $MAP[$key] ?? null) { + if ($mapped= $mdta[$key] ?? null) { $r[$mapped]= $value[0]; } } // Prefer original creation date from iOS, converting it to local time if ($date= $meta['mdta:com.apple.quicktime.creationdate'][0] ?? null) { - $r['dateTime']= new Date(preg_replace('/[+-][0-9]{4}$/', '', $date))->toString('c', self::$UTC); + $r['dateTime']= new Date(preg_replace('/[+-][0-9]{4}$/', '', $date))->toString(self::DATEFORMAT); } // Aggregate information from movie header: Duration and creation time // Time info is the number of seconds since 1904-01-01 00:00:00 UTC if (isset($meta['mvhd'])) { $r['duration']= round($meta['mvhd']['duration'] / $meta['mvhd']['scale'], 3); - $r['dateTime']??= new Date($meta['mvhd']['created'] - 2082844800)->toString('c', self::$UTC); + $r['dateTime']??= new Date($meta['mvhd']['created'] - 2082844800)->toString(self::DATEFORMAT); } return $r;