Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions gen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,11 @@ func main() {
cmd.Stderr = &errorBuf

if err := cmd.Run(); err != nil {
if strings.Contains(errorBuf.String(), "identify:") {
// We have some corrupt images.
return nil
}
return err
// identify may fail for corrupt images (prefix "identify:") or
// unsupported formats (e.g. RAW files without a darktable/libraw delegate).
// Non-fatal: readGoldenInfo already handles missing .config.json via os.IsNotExist.
log.Printf("warning: identify failed for %s: %s (skipping config.json)", path, errorBuf.String())
return nil
}

imageConfigOutFilename := filepath.Join(outDir, basePath+".config.json")
Expand Down
1 change: 1 addition & 0 deletions gen/testdata_exiftool/images/sample.arw.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"width": 3880, "height": 2600}
203 changes: 203 additions & 0 deletions gen/testdata_exiftool/images/sample.arw.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,203 @@
[{
"SourceFile": "testdata/images/sample.arw",
"ExifTool": {
"ExifToolVersion": 13.50
},
"File": {
"FileName": "sample.arw",
"Directory": "testdata/images",
"FileSize": 9601024,
"FilePermissions": 100644,
"FileType": "ARW",
"FileTypeExtension": "ARW",
"MIMEType": "image/x-sony-arw",
"ExifByteOrder": "II"
},
"EXIF": {
"ImageDescription": "SONY DSC",
"Make": "SONY",
"Model": "DSLR-A330",
"Software": "DSLR-A330 v1.10",
"ModifyDate": "2009:11:13 13:33:25",
"SubfileType": 0,
"ImageWidth": 3880,
"ImageHeight": 2600,
"BitsPerSample": 12,
"Compression": 32767,
"PhotometricInterpretation": 32803,
"Orientation": 1,
"SamplesPerPixel": 1,
"PlanarConfiguration": 1,
"XResolution": 0.01388888889,
"YResolution": 0.01388888889,
"ResolutionUnit": 3,
"CFARepeatPatternDim": "2 2",
"CFAPattern2": "0 1 1 2",
"SonyRawFileType": 3,
"SonyToneCurve": "8000 10400 12900 14100",
"StripOffsets": 688128,
"RowsPerStrip": 2600,
"StripByteCounts": 8883620,
"PreviewImageStart": 155683,
"PreviewImageLength": 530370,
"ExposureTime": 0.00625,
"FNumber": 4.5,
"ExposureProgram": 2,
"ISO": 100,
"ExifVersion": "0221",
"DateTimeOriginal": "2009:11:13 13:33:25",
"CreateDate": "2009:11:13 13:33:25",
"ComponentsConfiguration": "1 2 3 0",
"CompressedBitsPerPixel": 8,
"BrightnessValue": 6.75,
"ExposureCompensation": 0,
"MaxApertureValue": 4,
"MeteringMode": 2,
"LightSource": 0,
"Flash": 16,
"FocalLength": 100,
"UserComment": "",
"FlashpixVersion": "0100",
"ColorSpace": 1,
"ExifImageWidth": 3880,
"ExifImageHeight": 2600,
"InteropIndex": "R98",
"InteropVersion": "0100",
"FileSource": 3,
"SceneType": 1,
"CustomRendered": 0,
"ExposureMode": 2,
"WhiteBalance": 0,
"FocalLengthIn35mmFormat": 150,
"SceneCaptureType": 0,
"Contrast": 0,
"Saturation": 0,
"Sharpness": 0,
"ThumbnailOffset": 32770,
"ThumbnailLength": 3598
},
"MakerNotes": {
"AFPointSelected": 1,
"FocusModeSetting": 1,
"AFPoint": 4,
"AFStatusActiveSensor": 759,
"AFStatusTop-right": -32768,
"AFStatusBottom-right": -32768,
"AFStatusBottom": 948,
"AFStatusMiddleHorizontal": 1136,
"AFStatusCenterVertical": 759,
"AFStatusTop": 1387,
"AFStatusTop-left": 1410,
"AFStatusBottom-left": -32768,
"AFStatusLeft": -32768,
"AFStatusCenterHorizontal": -32768,
"AFStatusRight": 1136,
"DriveMode2": 7,
"Rotation": 0,
"ImageStabilizationSetting": 1,
"DynamicRangeOptimizerMode": 0,
"BracketShotNumber": 0,
"WhiteBalanceBracketing": 0,
"BracketShotNumber2": 0,
"DynamicRangeOptimizerBracket": 0,
"ExposureBracketShotNumber": 0,
"ExposureProgram": 2,
"ISOSetting": 100,
"ISO": 100,
"DynamicRangeOptimizerLevel": 1,
"ShutterCount": 78,
"FocusPosition": 128,
"TiffMeteringImage": "(Binary data 7404 bytes, use -b option to extract)",
"Quality": 6,
"FlashExposureComp": 0,
"Teleconverter": 0,
"WhiteBalanceFineTune": 0,
"ExposureTime": 0.0055242717280199,
"FNumber": 4.36203093066103,
"HighSpeedSync": 0,
"ExposureCompensationSet": 0,
"WhiteBalanceSetting": 2,
"ColorTemperatureSet": 5500,
"ColorCompensationFilterSet": 0,
"CustomWB_RGBLevels": "0 0 0",
"ColorTemperatureCustom": 5500,
"ColorCompensationFilterCustom": 0,
"AFAreaMode": 2,
"AFPointSetting": 1,
"FlashExposureCompSet": 0,
"MeteringMode": 2,
"FlashControl": 0,
"ImageStyle": 1,
"ShutterSpeedSetting": 0.324209888662752,
"ApertureSetting": 3.66801617281868,
"FlashAction": 0,
"AELock": 1,
"FlashAction2": 5,
"FocusMode": 1,
"FocusStatus": 1,
"SonyImageSize": 1,
"AspectRatio": 1,
"ExposureLevelIncrements": 33,
"DriveMode": 7,
"FlashMode": 5,
"ColorSpace": 6,
"WhiteBalance": 0,
"BatteryLevel": 85,
"Rating": 0,
"LongExposureNoiseReduction": 4294901760,
"HighISONoiseReduction": 0,
"FileFormat": "3 1 0 0",
"SonyModelID": 264,
"CreativeStyle": "Standard",
"ColorTemperature": 0,
"ColorCompensationFilter": 0,
"SceneMode": 0,
"ZoneMatching": 0,
"DynamicRangeOptimizer": 0,
"ImageStabilization": 1,
"LensType": 56,
"ColorMode": 0,
"LensSpec": "01 55 200 4 5.6 02",
"FullImageSize": "3872 2592",
"PreviewImageSize": "1616 1080",
"SR2SubIFDOffset": 36496,
"SR2SubIFDLength": 30960,
"SR2SubIFDKey": 1144201745,
"FirmwareID": 21870002,
"SensorHeight": 2608,
"SensorWidth": 3880,
"ImageHeight": 2592,
"ImageWidth": 3872,
"RawDepth": 16,
"BitDepth": 12,
"StorageMethod": 82,
"BayerPattern": 0,
"WBScale": "2 2 2 2",
"Saturation": 0,
"Contrast": 0,
"Sharpness": 0,
"WBMode": 0,
"ProgramMode": 128,
"BWFilter": 0,
"Hue": -1,
"BlackLevel": "0 0 0 0",
"WB_RGGBLevelsAuto": "1800 1024 1024 1584",
"WB_RGGBLevels": "1800 1024 1024 1584",
"ColorMatrix": "1208 -168 -16 -40 1168 -104 -8 16 1016",
"WB_RGBLevelsDaylight": "1740 1024 1660",
"WB_RGBLevelsCloudy": "1880 1024 1492",
"WB_RGBLevelsTungsten": "1032 1024 3288",
"WB_RGBLevelsFlash": "1924 1024 1476",
"WB_RGBLevels4500K": "1560 1024 1920",
"WB_RGBLevelsShade": "2056 1024 1292",
"WB_RGBLevelsFluorescent": "1604 1024 2372",
"WB_RGBLevelsFluorescentP1": "1812 1024 1976",
"WB_RGBLevelsFluorescentP2": "2208 1024 1704",
"WB_RGBLevelsFluorescentM1": "1228 1024 3112",
"WB_RGBLevels8500K": "2160 1024 1200",
"WB_RGBLevels6000K": "1856 1024 1500",
"WB_RGBLevels3200K": "1172 1024 2804",
"WB_RGBLevels2500K": "872 1024 3996",
"WhiteLevel": 15360
}
}]
1 change: 1 addition & 0 deletions gen/testdata_exiftool/images/sample.cr2.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"width": 3648, "height": 2736}
Loading