Skip to content

JPEG: Fix decoding of images with invalid color metadata #3843

Description

@graciousgrey

The mentioned file below can only be indexed if the exif metadata is removed. The mime type matches the file extension.

Acceptance Criteria:

  • Check what part of the photo's metadata causes indexing to fail.
  • Check if we can fix the metadata so that the file can be indexed.
 "ExifToolVersion": 12.40,
  "Directory": ".",
  "FileSize": "2.5 MiB",
  "FileModifyDate": "2023:10:24 13:18:51+02:00",
  "FileAccessDate": "2023:10:24 13:19:24+02:00",
  "FileInodeChangeDate": "2023:10:24 13:19:23+02:00",
  "FilePermissions": "-rw-rw-r--",
  "FileType": "JPEG",
  "FileTypeExtension": "jpg",
  "MIMEType": "image/jpeg",
  "ExifByteOrder": "Little-endian (Intel, II)",
  "ImageDescription": "",
  "Make": "vivo",
  "Model": "V2037",
  "Orientation": "Unknown (0)",
  "XResolution": 72,
  "YResolution": 72,
  "ResolutionUnit": "inches",
  "Software": "MediaTek Camera Application",
  "ModifyDate": "2023:10:01 13:49:23",
  "YCbCrPositioning": "Co-sited",
  "ExposureTime": "1/7299",
  "FNumber": 2.2,
  "ExposureProgram": "Not Defined",
  "ISO": 105,
  "SensitivityType": "Unknown",
  "RecommendedExposureIndex": 0,
  "ExifVersion": "0220",
  "DateTimeOriginal": "2023:10:01 13:49:23",
  "CreateDate": "2023:10:01 13:49:23",
  "ComponentsConfiguration": "Y, Cb, Cr, -",
  "ShutterSpeedValue": "1/7297",
  "BrightnessValue": 0,
  "ExposureCompensation": 0,
  "MaxApertureValue": 2.0,
  "MeteringMode": "Center-weighted average",
  "LightSource": "Other",
  "Flash": "No Flash",
  "FocalLength": "3.7 mm",
  "Warning": "Invalid EXIF text encoding for UserComment",
  "UserComment": "filter: 0; jpegRotation: 90; fileterIntensity: 0.000000; filterMask: 0; ",
  "SubSecTime": 549,
  "SubSecTimeOriginal": 549,
  "SubSecTimeDigitized": 549,
  "FlashpixVersion": "0100",
  "ColorSpace": "sRGB",
  "ExifImageWidth": 2340,
  "ExifImageHeight": 4160,
  "InteropIndex": "R98 - DCF basic file (sRGB)",
  "InteropVersion": "0100",
  "ExposureMode": "Auto",
  "WhiteBalance": "Auto",
  "DigitalZoomRatio": 1,
  "FocalLengthIn35mmFormat": "27 mm",
  "SceneCaptureType": "Standard",
  "GPSVersionID": "0.0.0.0",
  "GPSLatitudeRef": "Unknown ()",
  "GPSLongitudeRef": "Unknown ()",
  "GPSAltitudeRef": "Above Sea Level",
  "GPSAltitude": "undef",
  "GPSTimeStamp": "00:00:00",
  "GPSProcessingMethod": "",
  "GPSDateStamp": "",
  "Compression": "JPEG (old-style)",
  "ThumbnailOffset": 1664,
  "ThumbnailLength": 63744,
  "ImageWidth": 2340,
  "ImageHeight": 4160,
  "EncodingProcess": "Baseline DCT, Huffman coding",
  "BitsPerSample": 8,
  "ColorComponents": 3,
  "YCbCrSubSampling": "YCbCr4:2:0 (2 2)",
  "Aperture": 2.2,
  "ImageSize": "2340x4160",
  "Megapixels": 9.7,
  "ScaleFactor35efl": 7.4,
  "ShutterSpeed": "1/7299",
  "SubSecCreateDate": "2023:10:01 13:49:23.549",
  "SubSecDateTimeOriginal": "2023:10:01 13:49:23.549",
  "SubSecModifyDate": "2023:10:01 13:49:23.549",
  "ThumbnailImage": "(Binary data 63744 bytes, use -b option to extract)",
  "GPSDateTime": " 00:00:00Z",
  "GPSLatitude": "",
  "GPSLongitude": "",
  "CircleOfConfusion": "0.004 mm",
  "FOV": "67.4 deg",
  "FocalLength35efl": "3.7 mm (35 mm equivalent: 27.0 mm)",
  "HyperfocalDistance": "1.49 m",
  "LightValue": 15.0

Discussed in #3782

Originally posted by picklerick323 October 3, 2023
I have been getting this error in a couple of photos that I upload. I've attached a photo that gives me the error.

thumb: unrecognised image format in 20231001_134923_0D85D20D.jpg (read color metadata)
2023-10-02 16:31:25
index: failed creating thumbnails for 2023/10/20231001_134923_0D85D20D.jpg (image: unknown format while decoding)
2023-10-02 16:31:25

20231001_134923_0D85D20D

Metadata

Metadata

Assignees

Labels

releasedAvailable in a stable releasetestedChanges have been tested successfully

Type

No type

Projects

Status
Release 🌈

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions