{"record":{"id":"710ec96a0d39ab73","repo":"SixLabors/ImageSharp","slug":"data-type-datatype-is-not-supported","errorCode":null,"errorMessage":"Data type {dataType} is not supported.","messagePattern":"Data type (.+?) is not supported\\.","errorType":"exception","errorClass":"NotSupportedException","httpStatus":null,"severity":"error","filePath":"src/ImageSharp/Metadata/Profiles/Exif/ExifReader.cs","lineNumber":384,"sourceCode":"                return ToArray(dataType, buffer, this.ConvertToSingle);\n            case ExifDataType.Long8:\n            case ExifDataType.Ifd8:\n                if (!isArray)\n                {\n                    return this.ConvertToUInt64(buffer);\n                }\n\n                return ToArray(dataType, buffer, this.ConvertToUInt64);\n            case ExifDataType.SignedLong8:\n                if (!isArray)\n                {\n                    return this.ConvertToInt64(buffer);\n                }\n\n                return ToArray(dataType, buffer, this.ConvertToUInt64);\n\n            default:\n                throw new NotSupportedException($\"Data type {dataType} is not supported.\");\n        }\n    }\n\n    private void ReadValue(List<IExifValue> values, Span<byte> offsetBuffer)\n    {\n        // 2   | 2    | 4     | 4\n        // tag | type | count | value offset\n        if ((this.data.Length - this.data.Position) < 12)\n        {\n            return;\n        }\n\n        ExifTagValue tag = (ExifTagValue)this.ReadUInt16();\n        ExifDataType dataType = EnumUtils.Parse(this.ReadUInt16(), ExifDataType.Unknown);\n\n        uint numberOfComponents = this.ReadUInt32();\n\n        this.TryReadSpan(offsetBuffer);","sourceCodeStart":366,"sourceCodeEnd":402,"githubUrl":"https://github.com/SixLabors/ImageSharp/blob/59ce6af6fc29027cda277ef62d4d1694a8acce91/src/ImageSharp/Metadata/Profiles/Exif/ExifReader.cs#L366-L402","documentation":"ExifReader.ConvertValue switches on the EXIF data type read from an IFD entry; if the type code is outside the set ImageSharp knows (including the BigTIFF 64-bit variants it handles), it throws NotSupportedException. This indicates an unrecognized/unsupported EXIF type code in the file.","triggerScenarios":"Reading an EXIF/TIFF directory entry whose type field contains an unsupported data type code — usually because the file uses vendor-specific or newer-spec types ImageSharp doesn't implement, or the entry's type bytes are corrupt.","commonSituations":"Decoding images with non-standard EXIF written by exotic tools or cameras; corrupt files where type codes were overwritten; files mixing EXIF flavors the library doesn't fully support.","solutions":["Check whether the failing file's EXIF is nonstandard; strip or normalize EXIF metadata with exiftool/ImageMagick before processing.","Catch NotSupportedException around metadata load if unsupported metadata is nonessential to your workflow.","Report the type code upstream / upgrade ImageSharp in case support was added for that type."],"exampleFix":"// before\nusing var image = Image.Load(path); // throws on unsupported EXIF type\n// after\ntry\n{\n    using var image = Image.Load(path);\n}\ncatch (NotSupportedException ex)\n{\n    logger.LogWarning(\"Unsupported EXIF data type in {Path}: {Msg}\", path, ex.Message);\n    // proceed without metadata or use a fallback loader\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { using var image = Image.Load(path); }\ncatch (NotSupportedException ex) when (ex.Message.Contains(\"Data type\"))\n{ /* strip EXIF with exiftool and retry, or proceed without metadata */ }","preventionTips":["Normalize incoming images' metadata with exiftool/ImageMagick if exotic cameras are in the pipeline.","Treat EXIF metadata as optional: design the pipeline to tolerate its absence.","Keep ImageSharp current to pick up support for newer EXIF data types."],"tags":["exif","metadata","unsupported-datatype","parsing"],"backgroundTag":"unsupported-enum-value","analyzedSha":"59ce6af6fc29027cda277ef62d4d1694a8acce91","analyzedAt":"2026-09-13T18:34:59.331Z","contentChangedAt":"2026-09-13T18:34:59.331Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}