diff --git a/gen/main.go b/gen/main.go index 074a3bb..93f6c6c 100644 --- a/gen/main.go +++ b/gen/main.go @@ -25,7 +25,7 @@ func main() { if err != nil { return err } - if info.IsDir() || strings.HasPrefix(info.Name(), ".") { + if info.IsDir() || strings.HasPrefix(info.Name(), ".") || strings.HasSuffix(info.Name(), ".txt") { return nil } diff --git "a/gen/testdata_exiftool/images/bep/j\303\270lstravatnet.pef.config.json" "b/gen/testdata_exiftool/images/bep/j\303\270lstravatnet.pef.config.json" new file mode 100644 index 0000000..0324003 --- /dev/null +++ "b/gen/testdata_exiftool/images/bep/j\303\270lstravatnet.pef.config.json" @@ -0,0 +1 @@ +{"width": 6040, "height": 4032} \ No newline at end of file diff --git "a/gen/testdata_exiftool/images/bep/j\303\270lstravatnet.pef.json" "b/gen/testdata_exiftool/images/bep/j\303\270lstravatnet.pef.json" new file mode 100644 index 0000000..587eb67 --- /dev/null +++ "b/gen/testdata_exiftool/images/bep/j\303\270lstravatnet.pef.json" @@ -0,0 +1,236 @@ +[{ + "SourceFile": "../testdata/images/bep/jølstravatnet.pef", + "ExifTool": { + "ExifToolVersion": 13.50 + }, + "File": { + "FileName": "jølstravatnet.pef", + "Directory": "../testdata/images/bep", + "FileSize": 31326570, + "FilePermissions": 100644, + "FileType": "PEF", + "FileTypeExtension": "PEF", + "MIMEType": "image/x-pentax-pef", + "ExifByteOrder": "II" + }, + "EXIF": { + "ImageWidth": 6080, + "ImageHeight": 4032, + "BitsPerSample": 14, + "Compression": 65535, + "PhotometricInterpretation": 32803, + "Make": "RICOH IMAGING COMPANY, LTD.", + "Model": "PENTAX K-3 II", + "StripOffsets": 159648, + "Orientation": 1, + "SamplesPerPixel": 1, + "RowsPerStrip": 4032, + "StripByteCounts": 28357031, + "XResolution": 300, + "YResolution": 300, + "PlanarConfiguration": 1, + "ResolutionUnit": 2, + "Software": "PENTAX K-3 II Ver. 1.10", + "ModifyDate": "2021:02:05 10:56:53", + "Artist": "bjorn.erik.pedersen@gmail.com", + "Copyright": "", + "ExposureTime": 0.025, + "FNumber": 7.1, + "ExposureProgram": 3, + "ISO": 100, + "SensitivityType": 1, + "StandardOutputSensitivity": 100, + "DateTimeOriginal": "2021:02:05 10:56:53", + "CreateDate": "2021:02:05 10:56:53", + "ExposureCompensation": 0, + "MeteringMode": 5, + "Flash": 16, + "FocalLength": 50, + "SensingMethod": 2, + "CFAPattern": "2 2 0 1 1 2", + "CustomRendered": 0, + "ExposureMode": 0, + "WhiteBalance": 0, + "FocalLengthIn35mmFormat": 75, + "SceneCaptureType": 0, + "Contrast": 2, + "Saturation": 0, + "Sharpness": 2, + "SubjectDistanceRange": 3, + "GPSVersionID": "2 3 0 0", + "GPSLatitudeRef": "N", + "GPSLatitude": 61.5554583333333, + "GPSLongitudeRef": "E", + "GPSLongitude": 6.46989666666667, + "GPSAltitudeRef": 0, + "GPSAltitude": 239.8, + "GPSTimeStamp": "08:57:13", + "GPSSatellites": "09", + "GPSStatus": "A", + "GPSMeasureMode": 3, + "GPSSpeedRef": "K", + "GPSSpeed": 0.14, + "GPSTrackRef": "T", + "GPSTrack": 175.85, + "GPSImgDirectionRef": "T", + "GPSImgDirection": 22.62, + "GPSMapDatum": "WGS-84", + "GPSProcessingMethod": "GPS", + "GPSDateStamp": "2021:02:05", + "ThumbnailOffset": 153088, + "ThumbnailLength": 6540, + "JpgFromRawStart": 28516704, + "JpgFromRawLength": 2809866 + }, + "MakerNotes": { + "PentaxVersion": "11 6 1 0", + "PentaxModelType": 0, + "PreviewImageSize": "720 480", + "PreviewImageLength": 53753, + "PreviewImageStart": 73952, + "PentaxModelID": 77980, + "Date": "2021:02:05", + "Time": "10:56:53", + "Quality": 4, + "FlashMode": "1 63", + "FocusMode": 16, + "AFPointSelected": "65535 0", + "AFPointsInFocus": 0, + "ExposureTime": 0.025, + "FNumber": 7.1, + "ISO": 6, + "ExposureCompensation": 0, + "MeteringMode": 0, + "AutoBracketing": "0 0", + "WhiteBalance": 0, + "FocalLength": 50, + "Saturation": 1, + "Contrast": 4, + "Sharpness": 4, + "DSPFirmwareVersion": "1 10 22 06", + "EffectiveLV": 11, + "PictureMode": "5 0 1", + "DriveMode": "0 0 0 0", + "ColorSpace": 0, + "DataScaling": 8192, + "PreviewImageBorders": "0 0 0 0", + "LensType": "8 242", + "ExtenderStatus": 0, + "CameraTemperature": 11, + "AELock": 0, + "NoiseReduction": 0, + "FlashExposureComp": "0 0", + "ImageTone": 1, + "ShakeReduction": 7, + "ShutterCount": 20897, + "FacesDetected": 0, + "FacePosition": "0 0", + "RawDevelopmentProcess": 13, + "Hue": 1, + "WhiteBalanceAutoAdjustment": 0, + "TungstenAWB": 1, + "DynamicRangeExpansion": "0 2 0 0", + "WorldTimeLocation": 0, + "HometownDST": 1, + "DestinationDST": 1, + "HometownCity": 69, + "DestinationCity": 69, + "HighLowKeyAdj": "0 0", + "ContrastHighlight": "0 0", + "ContrastShadow": "0 0", + "ContrastHighlightShadowAdj": 0, + "FineSharpness": "0 0", + "HighISONoiseReduction": "255 0", + "AFAdjustment": 0, + "MonochromeFilterEffect": 65535, + "MonochromeToning": 65535, + "FaceDetect": "5 0", + "FaceDetectFrameSize": "0 0", + "ShadowCorrection": "2 4", + "ISOAutoMinSpeed": "2 0", + "CrossProcess": 0, + "DistortionCorrection": 0, + "ChromaticAberrationCorrection": 1, + "PeripheralIlluminationCorr": 0, + "DiffractionCorrection": 16, + "WhiteLevel": 16317, + "BleachBypassToning": 65535, + "AspectRatio": 1, + "HDR": "0 0 0 0", + "IntervalShooting": "0 0", + "BlackPoint": "1 1 1 1", + "WhitePoint": "19200 8192 8192 11584", + "AEExposureTime": 0.025558774984342, + "AEAperture": 7.0250086414932, + "AE_ISO": 100, + "AEMaxAperture": 2.82842712474619, + "AEMaxAperture2": 2.82842712474619, + "AEMinAperture": 22.6274169979695, + "AEMinExposureTime": "0.000129475118625467", + "AutoAperture": 0, + "MinAperture": 0, + "LensFStops": 8.5, + "MinFocusDistance": 3, + "FocusRangeIndex": 3, + "LensFocalLength": 50, + "NominalMaxAperture": 2.82842712474619, + "NominalMinAperture": 22.6274169979695, + "MaxAperture": 2.82842712474619, + "AEMeteringSegments": "117 117 117 117 117 117 117 117 117 117 117 117 117 117 118 118 118 119 119 118 118 118 118 118 118 119 119 119 119 119 119 118 118 118 118 119 119 119 119 119 119 119 119 120 119 118 118 118 118 118 118 118 118 118 118 118 118 118 118 119 119 119 119 119 119 119 119 118 119 119 119 119 120 120 120 119 119 119 119 119 119 120 120 120 120 120 120 120 120 120 118 118 118 118 118 118 118 118 118 118 118 118 118 118 119 119 119 119 119 119 119 119 118 119 119 119 120 120 120 120 120 119 119 119 119 120 120 120 120 120 120 120 120 120 120 118 118 118 118 118 118 118 118 118 118 118 119 118 119 119 119 119 120 119 119 119 119 119 119 119 119 119 120 120 120 120 119 119 119 119 120 120 120 120 120 120 120 120 120 120 119 118 118 118 119 119 119 120 120 120 121 121 122 123 125 125 123 120 118 117 119 119 119 119 119 119 119 119 119 119 119 119 119 119 119 120 120 120 120 120 120 120 120 120 121 119 119 120 121 123 123 123 124 124 125 125 126 127 127 126 127 126 123 120 116 115 115 116 117 118 119 119 119 119 119 119 119 119 119 119 120 120 120 120 121 121 122 122 123 122 122 124 125 127 127 126 125 125 125 125 124 126 126 127 125 125 126 124 124 121 120 118 115 113 114 114 115 116 118 119 118 118 116 116 118 119 120 122 124 125 126 126 125 126 127 125 126 127 128 129 128 127 126 125 125 125 126 126 127 127 126 126 126 124 122 124 121 118 114 114 113 113 114 114 115 114 114 113 113 114 118 123 126 127 127 128 128 127 128 128 127 126 127 126 124 123 123 123 123 123 122 124 125 126 128 126 124 123 123 117 118 121 118 119 119 116 119 115 113 112 113 112 112 112 113 114 117 119 123 126 126 125 125 125 125 123 124 123 120 116 112 112 114 115 116 117 120 123 127 129 125 123 119 117 112 111 114 119 119 117 121 123 119 114 110 110 110 109 110 110 110 110 112 114 117 120 121 121 121 119 115 114 112 110 107 104 101 99 99 100 103 112 119 124 125 121 121 114 113 107 107 110 116 118 116 116 117 115 112 109 107 104 104 103 106 106 107 108 109 112 114 115 115 113 111 108 106 105 104 102 98 96 95 94 96 99 101 103 105 109 110 108 102 103 103 105 106 108 111 110 110 106 104 104 102 102 101 100 99 101 102 102 103 105 107 108 107 104 101 97 103 101 100 99 97 96 96 95 96 97 96 96 97 98 99 98 98 98 99 99 102 105 105 104 102 103 102 101 99 100 106 103 100 98 98 99 101 100 99 99 98 97 96 95 95 98 97 97 97 97 97 96 96 96 96 96 97 99 100 102 106 107 106 110 109 112 112 112 112 111 110 109 109 107 107 107 102 102 102 99 101 102 101 97 95 95 94 94 94 94 96 97 97 98 99 99 99 102 103 107 107 109 109 109 110 110 109 110 109 110 111 110 110 110 108 107 107 106 106 105 105 102 102 102 100 99 100 101 101 103 103 101 100 99 99 103 104 106 107 108 108 107 108 108 108 107 108 109 109 108 108 108 108 107 107 107 107 107 106 107 107 107 106 106 106 106 107 106 106 105 106 105 105 106 106 107 106 106 106 105 108 108 109 109 109 108 108 107 107 107 107 107 107 108 108 108 108 107 107 107 107 107 107 107 107 107 107 107 106 106 106 104 104 103 103 103 103 103 103 103 104 104 104 104 103 104 104 105 105 105 104 103 103 103 104 104 104 105 105 106 106 106 104 106 105 105 105 105 106 105 105 105 104 103 103 104 102 101 100 100 101 102 102 102 103 103 103 103 102 101 101 101 101 101 101 100 100 100 100 100 100 101 101 102 104 104 104 102 103 102 102 103 104 106 106 106 106 105 104 103 103 102 101 100 101 102 103 103 104 106 107 107 106 105 104 101 101 101 101 101 100 99 99 99 100 100 101 103 107 109 109 108 106 105 103 103 104 107 110 110 110 111 109 107 105 104 103 102 102 104 104 105 106 107 109 111 111 111 110 109 103 103 103 103 102 100 99 100 100 100 101 104 108 113 116 115 113 112 109 107 105 107 109 111 109 110 111 110 108 107 106 107 107 106 107 107 107 108 108 108 108 108 108 108 108 107 107 107 107 106 105 104 104 105 106 107 108 111 114 116 114 112 111 110 108 107 109 111 112 109 110 112 110 109 108 108 107 107 107 107 108 108 108 109 109 109 108 108 108 108 108 109 109 108 108 108 108 107 108 108 107 108 108 108 108 107 107 107 107 107 107 107 107 107 108 109 109 108 108 108 109 109 109 108 109 110 110 111 110 109 108 108 108 108 108 108 108 108 108 107 107 107 108 108 108 107 107 107 106 105 105 106 107 107 107 107 107 107 107 107 107 107 107 107 107 108 109 110 110 110 111 112 111 110 109 109 109 109 110 111 107 108 108 106 104 104 106 107 105 104 105 105 103 104 103 104 105 107 108 107 107 107 107 107 107 107 107 107 108 108 109 110 111 111 111 112 112 112 113 113 112 112 112 113 113 107 107 106 104 102 103 104 103 101 101 103 101 98 101 100 99 103 103 103 107 107 107 107 107 107 107 108 108 108 108 108 108 108 108 108 108 107 107 107 107 108 107 107 108 108 105 106 104 103 102 104 104 103 100 100 101 97 96 97 98 96 97 96 99 104 104 103 104 106 106 106 106 106 106 106 106 106 106 106 107 106 106 106 106 106 106 107 107 107 107 106 106 105 104 104 105 106 103 99 100 100 96 96 99 98 94 94 95 96 98 99 98 98 100 101 103 106 106 106 106 106 106 106 107 106 107 107 107 107 107 107 107 107 108 108 105 107 107 106 107 108 108 104 100 100 100 99 99 101 98 95 93 95 95 96 96 96 96 98 98 99 103 105 105 106 106 106 106 106 105 106 106 106 106 108 109 109 109 110 110 105 107 107 107 108 109 109 106 102 101 101 99 100 101 99 97 97 96 96 96 94 98 97 98 98 100 103 105 105 106 106 106 103 102 102 102 101 102 103 105 107 109 109 109 109 134 134 135 134 135 135 135 135 135 135 135 135 135 135 135 135 135 136 136 135 136 136 136 136 136 136 137 136 136 136 136 136 136 136 136 135 135 135 134 134 134 134 134 134 133 137 137 137 136 136 137 137 136 137 137 136 136 136 136 136 136 136 137 136 137 136 137 137 138 138 138 137 138 138 137 137 137 137 137 137 136 136 136 137 136 136 136 136 136 135 138 137 137 137 137 136 137 137 137 136 136 136 136 136 136 136 136 137 137 137 137 137 138 138 138 138 138 138 138 138 137 137 137 137 137 136 136 137 136 136 136 136 136 136 136 137 137 137 136 136 136 136 136 136 136 136 136 136 136 135 135 136 136 136 136 136 137 137 137 137 138 137 137 137 137 137 137 137 136 136 136 136 136 136 136 135 136 135 135 135 137 136 136 136 135 135 135 134 134 132 131 132 130 126 122 122 125 133 136 139 134 135 136 136 136 136 136 137 137 136 136 136 136 136 136 136 136 135 135 135 135 135 135 134 134 136 136 134 130 127 126 126 125 123 122 122 120 120 120 122 121 121 127 129 137 140 141 137 138 137 136 136 136 136 136 136 135 135 135 135 135 135 135 134 133 131 129 127 127 129 132 127 123 120 119 121 122 123 122 122 125 122 121 120 124 123 122 125 123 128 128 132 137 142 142 141 140 139 137 134 136 135 138 138 135 134 132 129 125 122 121 122 122 121 119 123 120 119 118 117 119 120 120 121 120 121 120 121 120 120 122 122 120 123 127 122 127 132 140 139 142 142 142 141 139 140 141 141 141 140 134 124 120 119 118 117 118 118 118 118 119 119 118 118 120 122 121 121 121 119 121 119 121 121 118 121 123 123 121 133 130 125 131 129 127 135 127 135 140 140 139 140 140 141 141 138 134 129 120 118 119 120 120 119 120 120 119 119 123 129 137 135 126 125 123 122 119 122 117 116 120 120 125 124 136 137 136 126 128 131 124 120 128 137 144 142 140 141 141 141 142 140 138 134 128 121 120 119 120 121 129 131 134 136 138 141 141 140 140 141 142 130 123 117 116 121 117 128 124 137 139 136 127 127 131 128 126 127 133 138 143 143 142 144 140 141 141 139 137 130 125 123 123 125 125 135 138 140 138 139 139 139 137 138 138 137 138 137 137 131 128 131 138 136 138 136 138 137 133 135 134 140 140 139 143 142 141 139 140 141 141 141 138 134 130 129 130 133 137 138 139 140 140 140 140 139 138 137 138 136 138 138 138 137 137 138 139 140 141 141 143 141 141 142 143 142 142 141 143 142 137 141 142 140 140 140 139 140 139 137 137 138 137 137 137 139 140 139 139 139 138 138 138 138 140 140 141 140 140 142 139 140 142 137 141 139 140 140 140 140 140 141 140 142 141 140 143 140 140 141 137 136 137 140 139 138 138 137 138 137 140 141 141 141 141 141 143 140 142 138 138 138 139 140 139 139 141 139 141 139 140 140 142 140 142 143 141 141 142 142 142 142 141 139 141 141 139 138 138 137 139 141 140 139 140 143 142 142 140 138 139 140 139 140 140 143 140 140 141 143 141 142 140 140 141 140 141 142 143 141 142 140 142 142 141 142 140 140 140 140 139 141 141 141 140 140 140 139 139 139 140 140 140 140 140 141 141 141 140 141 141 140 140 141 140 141 140 140 140 141 141 140 141 141 141 141 140 140 141 141 141 143 141 141 142 142 141 142 142 141 141 139 140 140 140 141 142 142 141 141 141 142 140 140 140 140 140 139 139 138 139 139 141 139 141 140 140 140 140 141 141 140 140 141 141 140 141 140 140 139 139 139 138 137 136 135 136 136 138 137 139 139 140 140 139 140 139 139 139 139 139 139 138 138 137 136 136 138 137 138 140 139 138 137 138 136 136 137 138 140 140 141 139 140 140 140 140 138 137 134 131 131 131 134 135 139 139 138 139 139 138 138 137 138 137 138 137 135 132 128 127 129 131 133 135 137 137 135 132 132 132 129 131 136 139 140 141 140 141 140 141 140 139 137 133 127 126 126 128 130 138 139 138 138 138 138 138 137 136 136 136 134 130 124 121 122 124 125 128 133 137 136 133 134 136 136 133 136 140 142 142 141 141 142 142 142 141 141 141 141 140 140 139 139 138 135 136 136 135 135 137 138 137 135 135 135 135 133 129 126 127 131 131 133 135 138 135 133 133 138 136 133 136 139 141 142 143 143 143 142 143 143 141 140 139 139 141 140 141 140 140 140 140 140 140 141 141 141 141 142 143 142 142 143 142 142 142 142 142 142 143 142 143 141 141 139 138 139 141 141 140 140 140 142 141 140 138 135 138 140 140 142 142 141 141 143 143 143 142 143 142 142 143 143 142 143 142 143 143 142 143 142 142 143 142 142 142 142 142 143 143 143 143 142 143 142 141 140 141 140 139 138 138 139 140 140 141 140 138 137 142 143 141 143 143 144 142 140 141 143 140 139 141 139 140 139 141 140 139 140 141 141 143 142 143 142 143 143 141 142 140 138 138 137 137 136 136 135 134 133 133 134 133 132 132 144 141 141 142 143 143 141 141 141 139 137 137 137 137 136 138 139 139 140 138 141 141 142 142 143 143 141 140 141 140 142 143 142 143 143 143 143 144 143 143 143 143 143 144 142 142 141 142 141 142 141 140 139 140 139 138 137 136 135 136 137 135 137 137 139 141 141 142 142 143 143 143 143 143 143 144 143 142 144 142 142 143 143 143 143 143 143 143 142 143 141 140 141 141 143 141 139 139 141 138 135 136 136 136 135 135 133 135 136 136 136 136 138 138 140 142 141 142 144 143 142 143 142 142 142 142 143 142 142 143 141 143 143 143 142 142 142 142 142 143 142 140 142 141 139 137 136 139 137 136 135 134 133 134 134 135 134 136 136 138 140 142 141 143 142 142 142 141 142 142 141 142 141 142 142 142 143 141 142 142 141 141 140 142 142 141 139 140 140 139 137 138 137 136 136 137 135 134 135 134 134 134 136 136 138 139 141 142 142 143 142 141 142 139 141 141 142 140 141 143 142 141 142 141 143 117 116 116 116 116 116 116 116 116 116 117 117 116 117 117 117 117 116 116 117 117 117 117 117 117 117 117 117 117 117 117 117 117 118 118 117 118 118 118 118 118 118 119 119 120 114 115 115 115 115 115 116 115 116 116 116 116 116 116 117 117 116 116 116 116 117 116 116 116 116 116 116 116 116 116 116 116 117 117 116 117 117 117 118 117 118 117 117 118 118 115 114 115 115 115 115 115 116 116 116 116 116 116 116 116 116 116 116 116 116 116 116 115 116 116 116 116 116 116 116 116 116 116 116 117 117 117 117 117 118 118 118 118 118 118 114 115 115 115 115 116 116 115 116 116 116 117 116 116 117 118 117 117 117 116 117 117 116 116 116 116 116 116 116 116 117 116 117 117 117 117 117 117 117 118 117 118 118 118 118 115 115 116 116 116 117 118 119 119 120 122 121 123 127 131 133 128 122 118 114 121 119 117 117 117 117 117 117 117 117 117 117 117 117 118 118 118 118 118 118 119 118 119 119 119 116 116 118 121 126 127 128 129 130 132 131 133 133 133 131 132 133 128 126 119 114 114 118 115 117 118 118 118 118 118 118 118 118 118 118 118 118 119 119 120 123 125 128 128 123 119 125 130 132 134 132 131 130 131 132 128 132 131 133 129 131 132 129 131 127 128 124 119 114 113 113 113 115 117 119 117 121 116 115 119 119 120 125 129 132 133 132 131 133 134 129 132 134 134 135 134 133 133 131 133 132 133 132 133 132 132 132 133 131 129 132 127 124 116 116 113 113 114 114 116 114 114 113 113 114 119 132 135 134 135 136 135 135 135 135 134 133 135 135 134 132 131 132 132 134 132 134 132 132 136 132 131 130 133 122 125 130 124 127 129 121 127 121 115 115 116 115 115 114 114 115 120 126 134 136 134 133 134 135 135 134 134 134 131 124 116 118 129 130 131 133 134 130 136 136 134 136 130 132 120 118 118 129 127 125 132 132 128 118 111 115 115 114 115 115 113 115 116 120 128 134 134 135 133 134 125 123 120 118 115 116 116 117 117 116 113 125 131 136 136 135 134 125 128 119 116 121 129 128 125 128 130 129 122 118 112 116 114 114 117 114 115 115 118 125 131 133 132 132 133 120 116 115 116 118 118 118 120 120 118 119 118 119 120 126 128 124 121 120 119 121 118 119 124 121 122 117 117 119 115 116 118 119 118 116 117 116 118 123 128 127 127 123 119 119 118 117 117 117 118 119 119 119 119 120 120 120 119 119 120 119 119 118 118 117 114 114 115 114 115 116 115 115 115 116 117 114 116 117 117 117 119 118 118 120 120 119 119 120 121 118 117 118 118 119 119 119 119 119 117 117 118 115 116 116 115 113 113 115 113 114 114 114 114 114 113 113 113 113 114 113 115 117 116 116 120 120 120 117 119 119 120 120 120 120 117 117 116 116 115 116 115 115 114 116 115 115 114 113 114 114 114 113 114 114 114 114 113 113 113 113 113 115 114 115 113 116 115 118 117 116 119 118 119 118 117 117 117 118 118 113 113 112 112 115 115 113 114 115 115 112 113 113 113 111 112 112 113 114 114 115 114 114 113 114 114 115 114 114 113 113 114 115 116 117 116 114 113 114 114 114 115 116 116 116 114 114 113 113 113 113 112 114 114 114 114 114 115 114 114 114 114 115 114 114 114 115 114 114 114 114 115 115 114 114 114 115 116 116 116 115 115 115 115 117 117 117 116 116 117 114 114 114 114 115 116 115 116 116 116 116 115 117 117 116 116 117 115 115 115 115 115 116 115 115 115 116 116 116 115 116 116 117 117 118 117 118 118 119 120 122 122 121 120 120 118 118 118 117 118 117 118 119 118 118 117 118 118 119 120 119 119 120 118 118 117 118 118 119 118 119 120 120 118 117 116 116 118 117 118 117 117 118 119 122 125 126 125 122 123 119 119 118 119 118 118 119 119 119 119 119 119 121 124 127 127 126 125 122 121 119 119 120 124 124 123 126 125 121 117 117 116 117 116 116 115 116 117 119 125 130 131 131 129 128 119 118 118 118 119 118 118 120 121 120 121 121 125 130 131 131 130 130 126 122 120 120 121 122 120 119 122 120 116 114 113 113 113 112 114 113 113 113 113 113 114 114 114 115 117 122 121 121 122 120 120 119 120 124 122 120 120 122 125 127 127 125 124 122 120 118 121 122 123 119 121 123 119 115 114 112 113 112 113 113 112 112 113 115 117 116 114 115 115 116 114 114 115 115 115 113 112 112 112 111 112 111 112 112 112 112 112 112 112 112 112 113 112 113 114 117 117 115 113 114 114 115 115 112 113 113 117 122 117 114 115 114 113 114 114 110 111 112 111 112 111 112 112 111 112 111 112 112 112 113 113 112 113 112 111 113 112 113 113 112 112 112 112 113 111 111 113 114 113 112 114 115 116 114 113 114 114 115 116 118 112 112 113 113 113 114 114 113 115 114 115 115 115 116 116 117 113 115 116 113 114 113 112 112 113 113 113 112 113 113 113 116 116 116 116 117 118 120 121 122 122 121 122 123 125 112 114 115 115 116 115 114 116 117 118 120 120 121 119 120 119 117 119 118 117 114 114 113 113 113 112 114 115 115 115 114 112 112 112 111 111 111 111 112 112 112 112 112 113 113 113 114 115 114 114 116 115 116 117 118 119 119 120 121 121 120 120 121 120 116 115 116 115 113 114 112 113 113 113 113 112 114 113 112 113 113 113 113 113 113 113 113 114 113 114 115 114 114 113 113 113 115 117 116 118 120 120 121 120 121 122 122 121 121 120 119 121 120 119 117 115 113 113 114 114 112 113 113 114 112 113 112 112 114 112 112 112 113 112 112 113 114 114 113 112 112 114 115 116 117 119 120 119 117 120 122 122 122 122 121 121 122 122 120 119 119 115 114 113 114 113 114 115 115 114 113 114 114 113 113 115 112 113 112 113 114 115 115 113 112 114 115 114 116 118 119 119 120 119 120 121 121 123 121 122 123 122 120 121 119 118 115 115 114 114 115 114 117 118 116 116 116 116 115 114 113 113 113 113 114", + "FlashMeteringSegments": "0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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0", + "ManufactureDate": "2015:05:06", + "ProductionCode": 2.2, + "InternalSerialNumber": 7078575, + "PowerSource": 2, + "BodyBatteryState": 5, + "BodyBatteryVoltage1": 7.12, + "BodyBatteryVoltage2": 6.84, + "ColorMatrixA2": "5857 2334 0 0 8192 0 0 335 7856", + "ColorMatrixB2": "13952 -4416 -1344 -1472 13792 -4128 128 -2816 10880", + "AFPredictor": 1, + "AFDefocus": 0, + "AFIntegrationTime": 0, + "AFHold": 2, + "KelvinWB_Daylight": "5205 0 2.1640625 1.42529296875", + "KelvinWB_01": "2500 0 1.1741943359375 2.5665283203125", + "KelvinWB_02": "2630 0 1.234619140625 2.4586181640625", + "KelvinWB_03": "2780 0 1.3050537109375 2.3409423828125", + "KelvinWB_04": "2940 0 1.3797607421875 2.2255859375", + "KelvinWB_05": "3130 0 1.4661865234375 2.1029052734375", + "KelvinWB_06": "3330 0 1.5537109375 1.9896240234375", + "KelvinWB_07": "3570 0 1.6531982421875 1.873291015625", + "KelvinWB_08": "3850 0 1.7611083984375 1.760009765625", + "KelvinWB_09": "4170 0 1.8734130859375 1.65380859375", + "KelvinWB_10": "4550 0 1.9923095703125 1.552978515625", + "KelvinWB_11": "5000 0 2.1151123046875 1.4598388671875", + "KelvinWB_12": "5560 0 2.2442626953125 1.3714599609375", + "KelvinWB_13": "6250 0 2.3739013671875 1.290771484375", + "KelvinWB_14": "7140 0 2.50439453125 1.2164306640625", + "KelvinWB_15": "8330 0 2.6326904296875 1.148193359375", + "KelvinWB_16": "10000 0 2.7550048828125 1.0860595703125", + "WBShiftAB": 0, + "WBShiftGM": 0, + "EVSteps": 1, + "SensitivitySteps": 0, + "LiveView": 0, + "SerialNumber": 6211161, + "SourceDirectoryIndex": 0, + "SourceFileIndex": 0, + "LevelOrientation": 1, + "CompositionAdjust": 0, + "RollAngle": 1.5, + "PitchAngle": 0.5, + "CompositionAdjustX": 0, + "CompositionAdjustY": 0, + "CompositionAdjustRotation": 0, + "ContrastDetectAFArea": "0 0 0 0", + "NumCAFPoints": 0, + "CAFGridSize": "0 0", + "CAFPointsInFocus": "", + "CAFPointsSelected": "", + "PixelShiftResolution": 0, + "SensorTemperature": 14.5, + "SensorTemperature2": 14.5 + } +}] diff --git a/gen/testdata_exiftool/images/bep/license.txt.json b/gen/testdata_exiftool/images/bep/license.txt.json deleted file mode 100644 index 155b806..0000000 --- a/gen/testdata_exiftool/images/bep/license.txt.json +++ /dev/null @@ -1,20 +0,0 @@ -[{ - "SourceFile": "../testdata/images/bep/license.txt", - "ExifTool": { - "ExifToolVersion": 13.50 - }, - "File": { - "FileName": "license.txt", - "Directory": "../testdata/images/bep", - "FileSize": 121, - "FilePermissions": 100644, - "FileType": "TXT", - "FileTypeExtension": "TXT", - "MIMEType": "text/plain", - "MIMEEncoding": "utf-8", - "ByteOrderMark": 0, - "Newlines": "", - "LineCount": 1, - "WordCount": 12 - } -}] diff --git a/gen/testdata_exiftool/images/goexif/license.txt.json b/gen/testdata_exiftool/images/goexif/license.txt.json deleted file mode 100644 index d6d249d..0000000 --- a/gen/testdata_exiftool/images/goexif/license.txt.json +++ /dev/null @@ -1,19 +0,0 @@ -[{ - "SourceFile": "../testdata/images/goexif/license.txt", - "ExifTool": { - "ExifToolVersion": 13.50 - }, - "File": { - "FileName": "license.txt", - "Directory": "../testdata/images/goexif", - "FileSize": 167, - "FilePermissions": 100644, - "FileType": "TXT", - "FileTypeExtension": "TXT", - "MIMEType": "text/plain", - "MIMEEncoding": "us-ascii", - "Newlines": "\n", - "LineCount": 6, - "WordCount": 17 - } -}] diff --git a/gen/testdata_exiftool/images/license.txt.json b/gen/testdata_exiftool/images/license.txt.json deleted file mode 100644 index 0b9c6bc..0000000 --- a/gen/testdata_exiftool/images/license.txt.json +++ /dev/null @@ -1,19 +0,0 @@ -[{ - "SourceFile": "../testdata/images/license.txt", - "ExifTool": { - "ExifToolVersion": 13.50 - }, - "File": { - "FileName": "license.txt", - "Directory": "../testdata/images", - "FileSize": 116, - "FilePermissions": 100644, - "FileType": "TXT", - "FileTypeExtension": "TXT", - "MIMEType": "text/plain", - "MIMEEncoding": "us-ascii", - "Newlines": "\n", - "LineCount": 1, - "WordCount": 10 - } -}] diff --git a/gen/testdata_exiftool/images/metadata-extractor/license.txt.json b/gen/testdata_exiftool/images/metadata-extractor/license.txt.json deleted file mode 100644 index 22c2dd9..0000000 --- a/gen/testdata_exiftool/images/metadata-extractor/license.txt.json +++ /dev/null @@ -1,19 +0,0 @@ -[{ - "SourceFile": "../testdata/images/metadata-extractor/license.txt", - "ExifTool": { - "ExifToolVersion": 13.50 - }, - "File": { - "FileName": "license.txt", - "Directory": "../testdata/images/metadata-extractor", - "FileSize": 154, - "FilePermissions": 100644, - "FileType": "TXT", - "FileTypeExtension": "TXT", - "MIMEType": "text/plain", - "MIMEEncoding": "us-ascii", - "Newlines": "\n", - "LineCount": 6, - "WordCount": 10 - } -}] diff --git a/gen/testdata_exiftool/images/sample.arw.json b/gen/testdata_exiftool/images/sample.arw.json index 1e94d56..03af49c 100644 --- a/gen/testdata_exiftool/images/sample.arw.json +++ b/gen/testdata_exiftool/images/sample.arw.json @@ -1,12 +1,12 @@ [{ - "SourceFile": "testdata/images/sample.arw", + "SourceFile": "../testdata/images/sample.arw", "ExifTool": { "ExifToolVersion": 13.50 }, "File": { "FileName": "sample.arw", - "Directory": "testdata/images", - "FileSize": 9601024, + "Directory": "../testdata/images", + "FileSize": 102400, "FilePermissions": 100644, "FileType": "ARW", "FileTypeExtension": "ARW", diff --git a/gen/testdata_exiftool/images/sample.cr2.json b/gen/testdata_exiftool/images/sample.cr2.json index 5fd2faf..7b5a8f4 100644 --- a/gen/testdata_exiftool/images/sample.cr2.json +++ b/gen/testdata_exiftool/images/sample.cr2.json @@ -1,12 +1,12 @@ [{ - "SourceFile": "testdata/images/sample.cr2", + "SourceFile": "../testdata/images/sample.cr2", "ExifTool": { "ExifToolVersion": 13.50 }, "File": { "FileName": "sample.cr2", - "Directory": "testdata/images", - "FileSize": 13287537, + "Directory": "../testdata/images", + "FileSize": 51200, "FilePermissions": 100644, "FileType": "CR2", "FileTypeExtension": "CR2", diff --git a/gen/testdata_exiftool/images/sample.dng.json b/gen/testdata_exiftool/images/sample.dng.json index 2f6fcb4..dad29f2 100644 --- a/gen/testdata_exiftool/images/sample.dng.json +++ b/gen/testdata_exiftool/images/sample.dng.json @@ -1,12 +1,12 @@ [{ - "SourceFile": "testdata/images/sample.dng", + "SourceFile": "../testdata/images/sample.dng", "ExifTool": { "ExifToolVersion": 13.50 }, "File": { "FileName": "sample.dng", - "Directory": "testdata/images", - "FileSize": 6611520, + "Directory": "../testdata/images", + "FileSize": 51200, "FilePermissions": 100644, "FileType": "DNG", "FileTypeExtension": "DNG", diff --git a/gen/testdata_exiftool/images/sample.nef.json b/gen/testdata_exiftool/images/sample.nef.json index 5e79e12..968a2e6 100644 --- a/gen/testdata_exiftool/images/sample.nef.json +++ b/gen/testdata_exiftool/images/sample.nef.json @@ -1,12 +1,12 @@ [{ - "SourceFile": "testdata/images/sample.nef", + "SourceFile": "../testdata/images/sample.nef", "ExifTool": { "ExifToolVersion": 13.50 }, "File": { "FileName": "sample.nef", - "Directory": "testdata/images", - "FileSize": 4055474, + "Directory": "../testdata/images", + "FileSize": 76800, "FilePermissions": 100644, "FileType": "NEF", "FileTypeExtension": "NEF", diff --git a/imageformat_string.go b/imageformat_string.go index 4d5f847..dfd3151 100644 --- a/imageformat_string.go +++ b/imageformat_string.go @@ -19,16 +19,16 @@ func _() { _ = x[CR2-8] _ = x[NEF-9] _ = x[ARW-10] + _ = x[PEF-11] } -const _ImageFormat_name = "ImageFormatAutoJPEGTIFFPNGWebPHEIFAVIFDNGCR2NEFARW" +const _ImageFormat_name = "ImageFormatAutoJPEGTIFFPNGWebPHEIFAVIFDNGCR2NEFARWPEF" -var _ImageFormat_index = [...]uint8{0, 15, 19, 23, 26, 30, 34, 38, 41, 44, 47, 50} +var _ImageFormat_index = [...]uint8{0, 15, 19, 23, 26, 30, 34, 38, 41, 44, 47, 50, 53} func (i ImageFormat) String() string { - idx := int(i) - 0 - if i < 0 || idx >= len(_ImageFormat_index)-1 { + if i < 0 || i >= ImageFormat(len(_ImageFormat_index)-1) { return "ImageFormat(" + strconv.FormatInt(int64(i), 10) + ")" } - return _ImageFormat_name[_ImageFormat_index[idx]:_ImageFormat_index[idx+1]] + return _ImageFormat_name[_ImageFormat_index[i]:_ImageFormat_index[i+1]] } diff --git a/imagemeta.go b/imagemeta.go index 283a9a9..cc1e89d 100644 --- a/imagemeta.go +++ b/imagemeta.go @@ -25,7 +25,7 @@ const ( XMP // CONFIG source, which currently the image dimensions encoded in the image. - // Note that this must not be confused with the dimensions stored in EXIF tags. + // Note that this may not be the same as the dimensions stored in EXIF tags. CONFIG ) @@ -60,6 +60,8 @@ const ( NEF // ARW is the Sony ARW RAW image format. ARW + // PEF is the Pentax PEF RAW image format. + PEF ) // ImageConfig contains basic image configuration. @@ -75,7 +77,8 @@ type DecodeResult struct { ImageConfig ImageConfig } -// Decode reads EXIF and IPTC metadata from r and returns a Meta struct. +// Decode reads the metadata and passes it to the provided handlers in the options. +// It returns a DecodeResult containing the image configuration if the CONFIG source was requested. func Decode(opts Options) (result DecodeResult, err error) { var base *baseStreamingDecoder @@ -201,7 +204,7 @@ func Decode(opts Options) (result DecodeResult, err error) { sourceSet = EXIF | XMP | IPTC | CONFIG case HEIF, AVIF: sourceSet = EXIF | XMP | CONFIG - case DNG, CR2, NEF, ARW: + case DNG, CR2, NEF, ARW, PEF: sourceSet = EXIF | XMP | IPTC | CONFIG default: return result, fmt.Errorf("unsupported image format") @@ -243,7 +246,7 @@ func Decode(opts Options) (result DecodeResult, err error) { dec = &imageDecoderPNG{baseStreamingDecoder: base} case HEIF, AVIF: dec = &imageDecoderHEIF{baseStreamingDecoder: base} - case DNG, CR2, NEF, ARW: + case DNG, CR2, NEF, ARW, PEF: dec = &imageDecoderRAW{baseStreamingDecoder: base} } diff --git a/imagemeta_fuzz_test.go b/imagemeta_fuzz_test.go index b0c9f6d..b5c5c3e 100644 --- a/imagemeta_fuzz_test.go +++ b/imagemeta_fuzz_test.go @@ -129,6 +129,16 @@ func FuzzDecodeARW(f *testing.F) { }) } +func FuzzDecodePEF(f *testing.F) { + filenames := []string{"bep/jølstravatnet.pef"} + for _, filename := range filenames { + f.Add(readTestDataFileAll(f, filename)) + } + f.Fuzz(func(t *testing.T, imageBytes []byte) { + fuzzDecodeBytes(t, imageBytes, imagemeta.PEF) + }) +} + func fuzzDecodeBytes(t *testing.T, imageBytes []byte, f imagemeta.ImageFormat) error { r := bytes.NewReader(imageBytes) _, err := imagemeta.Decode(imagemeta.Options{R: r, ImageFormat: f, Sources: imagemeta.EXIF | imagemeta.IPTC | imagemeta.XMP | imagemeta.CONFIG, Timeout: 600 * time.Millisecond}) diff --git a/imagemeta_test.go b/imagemeta_test.go index a834240..68962ba 100644 --- a/imagemeta_test.go +++ b/imagemeta_test.go @@ -138,6 +138,12 @@ func TestDecodeRAW(t *testing.T) { c.Assert(err, qt.IsNil) c.Assert(tags.EXIF()["Make"].Value, qt.Equals, "SONY") c.Assert(tags.EXIF()["Model"].Value, qt.Equals, "DSLR-A330") + + // PEF (Pentax K-3 II) + _, tags, err = extractTags(t, "bep/jølstravatnet.pef", imagemeta.EXIF) + c.Assert(err, qt.IsNil) + c.Assert(tags.EXIF()["Make"].Value, qt.Equals, "RICOH IMAGING COMPANY, LTD.") + c.Assert(tags.EXIF()["Model"].Value, qt.Equals, "PENTAX K-3 II") } func TestDecodeRAWConfig(t *testing.T) { @@ -149,10 +155,11 @@ func TestDecodeRAWConfig(t *testing.T) { width int height int }{ - {"sample.dng", imagemeta.DNG, 2592, 1944}, // DefaultCropSize - {"sample.cr2", imagemeta.CR2, 3648, 2736}, // ExifIFD dimensions - {"sample.nef", imagemeta.NEF, 2012, 1324}, // SubIFD dimensions - {"sample.arw", imagemeta.ARW, 3880, 2600}, // ExifIFD dimensions + {"sample.dng", imagemeta.DNG, 2592, 1944}, // DefaultCropSize + {"sample.cr2", imagemeta.CR2, 3648, 2736}, // ExifIFD dimensions + {"sample.nef", imagemeta.NEF, 2012, 1324}, // SubIFD dimensions + {"sample.arw", imagemeta.ARW, 3880, 2600}, // ExifIFD dimensions + {"bep/jølstravatnet.pef", imagemeta.PEF, 6080, 4032}, // IFD0 dimensions } for _, tt := range tests { @@ -1061,6 +1068,8 @@ func extToFormat(ext string) imagemeta.ImageFormat { return imagemeta.NEF case ".arw": return imagemeta.ARW + case ".pef": + return imagemeta.PEF case ".txt": return -1 default: @@ -1192,7 +1201,7 @@ func withTestDataFile(t testing.TB, fn func(path string, info os.FileInfo, err e return err } - if info.IsDir() || strings.HasPrefix(info.Name(), ".") { + if info.IsDir() || strings.HasPrefix(info.Name(), ".") || strings.HasSuffix(info.Name(), ".txt") { return nil } @@ -1210,6 +1219,7 @@ var goldenSkip = map[string]bool{ "invalid-encoding-usercomment.jpg": true, // The file has an EXIF error that produces a warning in imagemeta. It's tested separately. "sample.cr2": true, // CR2 chains 4 IFDs; exiftool reports IFD3 StripByteCounts which we don't reach. "sample.arw": true, // IFD0 0x0201/0x0202 are preview offsets; exiftool renames to PreviewImageStart/Length so values differ. + "bep/jølstravatnet.pef": true, // GPSProcessingMethod includes encoding prefix; CONFIG dimensions differ (identify uses libraw active area). } var isSpaceDelimitedFloatRe = regexp.MustCompile(`^(\d+\.\d+)( \d+\.?\d*)+$`) @@ -1431,6 +1441,7 @@ func BenchmarkDecode(b *testing.B) { {"cr2", imagemeta.CR2, "sample.cr2"}, {"nef", imagemeta.NEF, "sample.nef"}, {"arw", imagemeta.ARW, "sample.arw"}, + {"pef", imagemeta.PEF, "bep/jølstravatnet.pef"}, } { imageFormat = tt.format runBenchmarkWithFile(b, "exif/"+tt.name, tt.format, tt.filename, func(r io.ReadSeeker) error { diff --git a/metadecoder_exif.go b/metadecoder_exif.go index 9f02075..472f08c 100644 --- a/metadecoder_exif.go +++ b/metadecoder_exif.go @@ -145,7 +145,10 @@ var ( "BlackLevelRepeatDim": exifConverters.convertNumbersToSpaceLimited, "MaskedAreas": exifConverters.convertNumbersToSpaceLimited, "CFAPattern": func(ctx valueConverterContext, v any) any { - b := v.([]byte) + b, ok := typeAssert[[]byte](ctx, v) + if !ok { + return v + } horizontalRepeat := ctx.s.byteOrder.Uint16(b[:2]) verticalRepeat := ctx.s.byteOrder.Uint16(b[2:]) repeatLen := int(horizontalRepeat) * int(verticalRepeat) @@ -508,7 +511,9 @@ func (e *metaDecoderEXIF) decodeTag(namespace string) error { if tagName == tagNameThumbnailOffset { // When set, thumbnailOffset is set to the offset of the EXIF data in the original file. - val = val.(uint32) + uint32(e.readerOffset+e.thumbnailOffset) + if v, ok := typeAssert[uint32](e.valueConverterCtx, val); ok { + val = v + uint32(e.readerOffset+e.thumbnailOffset) + } } tagInfo.Value = val diff --git a/testdata/fuzz/FuzzDecodeDNG/85bf2db7be71f22e b/testdata/fuzz/FuzzDecodeDNG/85bf2db7be71f22e new file mode 100644 index 0000000..5b60f97 --- /dev/null +++ b/testdata/fuzz/FuzzDecodeDNG/85bf2db7be71f22e @@ -0,0 +1,2 @@ +go test fuzz v1 +[]byte("II*\x00\b\x00\x00\x000\x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000i\x87\x04\x00\x01\x00\x00\x00\x84\x02\x00\x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 \x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000\x02\xa3\x05\x00\x01\x00\x00\x00\x01\x04\x00\x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000") diff --git a/testdata/fuzz/FuzzDecodePEF/284853a7f4021859 b/testdata/fuzz/FuzzDecodePEF/284853a7f4021859 new file mode 100644 index 0000000..8a12ed2 --- /dev/null +++ b/testdata/fuzz/FuzzDecodePEF/284853a7f4021859 @@ -0,0 +1,2 @@ +go test fuzz v1 +[]byte("II*\x00\b\x00\x00\x000\x00\x01\x02\f\x00\x00\x00\x00\x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000") diff --git "a/testdata/images/bep/j\303\270lstravatnet.pef" "b/testdata/images/bep/j\303\270lstravatnet.pef" new file mode 100644 index 0000000..fe36f5e Binary files /dev/null and "b/testdata/images/bep/j\303\270lstravatnet.pef" differ