Closed sypets closed 7 months ago
When I use exiv2
instead of exiftool
, I get no aperture value at all (empty).
When I open the file in Photoshop and show the raw data, I see this:
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 9.1-c001 79.1462899777, 2023/06/25-23:57:14 ">
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about=""
xmlns:xmp="http://ns.adobe.com/xap/1.0/"
xmlns:aux="http://ns.adobe.com/exif/1.0/aux/"
xmlns:photoshop="http://ns.adobe.com/photoshop/1.0/"
xmlns:xmpMM="http://ns.adobe.com/xap/1.0/mm/"
xmlns:stEvt="http://ns.adobe.com/xap/1.0/sType/ResourceEvent#"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:tiff="http://ns.adobe.com/tiff/1.0/"
xmlns:exif="http://ns.adobe.com/exif/1.0/">
<xmp:Rating>0</xmp:Rating>
<xmp:ModifyDate>2016-11-02T20:19:53+01:00</xmp:ModifyDate>
<xmp:CreateDate>2016-10-14T12:27:50</xmp:CreateDate>
<xmp:MetadataDate>2016-11-02T20:19:53+01:00</xmp:MetadataDate>
<xmp:CreatorTool>Adobe Photoshop CS6 (Windows)</xmp:CreatorTool>
<aux:SerialNumber>193066081036</aux:SerialNumber>
<aux:LensSerialNumber>0000000000</aux:LensSerialNumber>
<aux:ImageNumber>0</aux:ImageNumber>
<aux:FlashCompensation>0/1</aux:FlashCompensation>
<aux:Firmware>1.0.2</aux:Firmware>
<photoshop:DateCreated>2016-10-14T12:27:50.051</photoshop:DateCreated>
<photoshop:LegacyIPTCDigest>A131B213AF678EAEA4799E62A6CB2F6B</photoshop:LegacyIPTCDigest>
<photoshop:ColorMode>3</photoshop:ColorMode>
<photoshop:ICCProfile>Adobe RGB (1998)</photoshop:ICCProfile>
<photoshop:DocumentAncestors>
<rdf:Bag>
<rdf:li>0A5E203B7520E1BDA3B8E707255064E5</rdf:li>
</rdf:Bag>
</photoshop:DocumentAncestors>
<xmpMM:DocumentID>0A5E203B7520E1BDA3B8E707255064E5</xmpMM:DocumentID>
<xmpMM:InstanceID>xmp.iid:5704885131A1E6118297B44227F13E8E</xmpMM:InstanceID>
<xmpMM:OriginalDocumentID>0A5E203B7520E1BDA3B8E707255064E5</xmpMM:OriginalDocumentID>
<xmpMM:History>
<rdf:Seq>
<rdf:li rdf:parseType="Resource">
<stEvt:action>saved</stEvt:action>
<stEvt:instanceID>xmp.iid:5504885131A1E6118297B44227F13E8E</stEvt:instanceID>
<stEvt:when>2016-11-02T20:19:47+01:00</stEvt:when>
<stEvt:softwareAgent>Adobe Photoshop CS6 (Windows)</stEvt:softwareAgent>
<stEvt:changed>/</stEvt:changed>
</rdf:li>
<rdf:li rdf:parseType="Resource">
<stEvt:action>saved</stEvt:action>
<stEvt:instanceID>xmp.iid:5704885131A1E6118297B44227F13E8E</stEvt:instanceID>
<stEvt:when>2016-11-02T20:19:53+01:00</stEvt:when>
<stEvt:softwareAgent>Adobe Photoshop CS6 (Windows)</stEvt:softwareAgent>
<stEvt:changed>/</stEvt:changed>
</rdf:li>
</rdf:Seq>
</xmpMM:History>
<dc:format>image/jpeg</dc:format>
<tiff:ImageWidth>3456</tiff:ImageWidth>
<tiff:ImageLength>5184</tiff:ImageLength>
<tiff:BitsPerSample>
<rdf:Seq>
<rdf:li>8</rdf:li>
<rdf:li>8</rdf:li>
<rdf:li>8</rdf:li>
</rdf:Seq>
</tiff:BitsPerSample>
<tiff:PhotometricInterpretation>2</tiff:PhotometricInterpretation>
<tiff:Orientation>1</tiff:Orientation>
<tiff:SamplesPerPixel>3</tiff:SamplesPerPixel>
<tiff:YCbCrPositioning>2</tiff:YCbCrPositioning>
<tiff:XResolution>72/1</tiff:XResolution>
<tiff:YResolution>72/1</tiff:YResolution>
<tiff:ResolutionUnit>2</tiff:ResolutionUnit>
<tiff:WhitePoint>
<rdf:Seq>
<rdf:li>313/1000</rdf:li>
<rdf:li>329/1000</rdf:li>
</rdf:Seq>
</tiff:WhitePoint>
<tiff:PrimaryChromaticities>
<rdf:Seq>
<rdf:li>64/100</rdf:li>
<rdf:li>33/100</rdf:li>
<rdf:li>21/100</rdf:li>
<rdf:li>71/100</rdf:li>
<rdf:li>15/100</rdf:li>
<rdf:li>6/100</rdf:li>
</rdf:Seq>
</tiff:PrimaryChromaticities>
<tiff:YCbCrCoefficients>
<rdf:Seq>
<rdf:li>299/1000</rdf:li>
<rdf:li>587/1000</rdf:li>
<rdf:li>114/1000</rdf:li>
</rdf:Seq>
</tiff:YCbCrCoefficients>
<tiff:Make>Canon</tiff:Make>
<tiff:Model>Canon EOS 600D</tiff:Model>
<exif:ExifVersion>0230</exif:ExifVersion>
<exif:FlashpixVersion>0100</exif:FlashpixVersion>
<exif:ColorSpace>65535</exif:ColorSpace>
<exif:PixelXDimension>1333</exif:PixelXDimension>
<exif:PixelYDimension>2000</exif:PixelYDimension>
<exif:DateTimeOriginal>2016-10-14T12:27:50</exif:DateTimeOriginal>
<exif:ExposureTime>1/1250</exif:ExposureTime>
<exif:FNumber>0/1</exif:FNumber>
<exif:ExposureProgram>1</exif:ExposureProgram>
<exif:ISOSpeedRatings>
<rdf:Seq>
<rdf:li>4000</rdf:li>
</rdf:Seq>
</exif:ISOSpeedRatings>
<exif:ShutterSpeedValue>679936/65536</exif:ShutterSpeedValue>
<exif:ApertureValue>-2147483648/1000000</exif:ApertureValue>
<exif:ExposureBiasValue>0/1</exif:ExposureBiasValue>
<exif:MeteringMode>5</exif:MeteringMode>
<exif:Flash rdf:parseType="Resource">
<exif:Fired>False</exif:Fired>
<exif:Return>0</exif:Return>
<exif:Mode>2</exif:Mode>
<exif:Function>False</exif:Function>
<exif:RedEyeMode>False</exif:RedEyeMode>
</exif:Flash>
<exif:FocalLength>50/1</exif:FocalLength>
<exif:FocalPlaneXResolution>5184000/905</exif:FocalPlaneXResolution>
<exif:FocalPlaneYResolution>3456000/595</exif:FocalPlaneYResolution>
<exif:FocalPlaneResolutionUnit>2</exif:FocalPlaneResolutionUnit>
<exif:CustomRendered>0</exif:CustomRendered>
<exif:ExposureMode>1</exif:ExposureMode>
<exif:WhiteBalance>0</exif:WhiteBalance>
<exif:SceneCaptureType>0</exif:SceneCaptureType>
<exif:SubSecTime>51</exif:SubSecTime>
<exif:SubSecTimeOriginal>51</exif:SubSecTimeOriginal>
<exif:SubSecTimeDigitized>51</exif:SubSecTimeDigitized>
<exif:SerialNumber>193066081036</exif:SerialNumber>
<exif:LensInfo>
<rdf:Seq>
<rdf:li>0/0</rdf:li>
</rdf:Seq>
</exif:LensInfo>
<exif:LensSerialNumber>0000000000</exif:LensSerialNumber>
<exif:SensitivityType>2</exif:SensitivityType>
<exif:RecommendedExposureIndex>4000</exif:RecommendedExposureIndex>
</rdf:Description>
</rdf:RDF>
</x:xmpmeta>
Thus in that case, the aperture is:
<exif:ApertureValue>-2147483648/1000000</exif:ApertureValue>
and -2147483648 is the smallest negative value in 32 bits, which indicates an overflow, thus infinity.
For me infinite aperture doesn't make any sense, it's the depth of field, or hyperfocal. An aperture is measured in f/
and logically the maximum value is f/1
and the smallest I know in any standard camera is f/32, thus 1/32
Aperture = size of the opening to the diaphragm:
=> the aperture for this photo makes no sense, is "wrong" and should be considered "empty".
That makes sense.
This should help, please test:
diff --git a/Configuration/Services/ExifTool/default.json b/Configuration/Services/ExifTool/default.json
index 8e6b701..6107d02 100644
--- a/Configuration/Services/ExifTool/default.json
+++ b/Configuration/Services/ExifTool/default.json
@@ -163,7 +163,7 @@
},
{
"FAL": "aperture",
- "DATA": "Aperture"
+ "DATA": "Aperture->Causal\\Extractor\\Utility\\Number::extractFloat"
},
{
"FAL": "flash",
diff --git a/Configuration/Services/Tika/default.json b/Configuration/Services/Tika/default.json
index 71efccc..095f069 100644
--- a/Configuration/Services/Tika/default.json
+++ b/Configuration/Services/Tika/default.json
@@ -163,7 +163,7 @@
},
{
"FAL": "aperture",
- "DATA": "exif:FNumber"
+ "DATA": "exif:FNumber->Causal\\Extractor\\Utility\\Number::extractFloat"
},
{
"FAL": "flash",
@xperseguers I tested with branch bugfix/77-infinite-aperture:
composer require causal/extractor:dev-bugfix/77-infinite-aperture
I uploaded a file which caused exception on metadata extraction due to invalid aperture "Inf" in previous version.
This is now ok!
exiftool output
`$exiftool MG_9719-600x400.jpg | grep -i aperture
` output:
open questions
Is this value correct for aperture? Unfortunately I have not found a good authoritative source for exif metadata.
Possibly, the extensions should do a sanity check if value has correct datatype / allowed values (e.g. is numeric) or TYPO3 should do it.
Logfile
SQL DB Schema (TYPO3)
sys_file_metadata
aperture | double | NO | | 0 | |