Skip to content

Commit

Permalink
BUGFIX: Catch values not being arrays despite being standardized as such
Browse files Browse the repository at this point in the history
  • Loading branch information
ComiR authored and daniellienert committed Nov 7, 2018
1 parent 5d41675 commit 8605a1a
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions Classes/Domain/Extractor/ExifExtractor.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ class ExifExtractor extends AbstractExtractor
'UndefinedTag:0xA433' => 'LensMake',
'UndefinedTag:0xA434' => 'LensModel',
'UndefinedTag:0xA435' => 'LensSerialNumber',
'UndefinedTag:0xA500' => 'Gamma',
];

/**
Expand Down Expand Up @@ -178,8 +179,15 @@ public function extractMetaData(FlowResource $resource, MetaDataCollection $meta

foreach (static::$rationalArrayProperties as $rationalArrayProperty) {
if (isset($exifData[$rationalArrayProperty])) {
foreach ($exifData[$rationalArrayProperty] as $key => $value) {
$exifData[$rationalArrayProperty][$key] = NumberConverter::convertRationalToFloat($value);
// Although defined as an array, some implementations only use one rational
if (\is_array($exifData[$rationalArrayProperty])) {
foreach ($exifData[$rationalArrayProperty] as $key => $value) {
$exifData[$rationalArrayProperty][$key] = NumberConverter::convertRationalToFloat($value);
}
} else {
$exifData[$rationalArrayProperty] = NumberConverter::convertRationalToFloat(
$exifData[$rationalArrayProperty]
);
}
}
}
Expand Down

0 comments on commit 8605a1a

Please sign in to comment.