{"record":{"id":"483b3a55ee698905","repo":"SixLabors/ImageSharp","slug":"invalid-entry-tag","errorCode":null,"errorMessage":"Invalid entry {tag}.","messagePattern":"Invalid entry (.+?)\\.","errorType":"exception","errorClass":"InvalidIccProfileException","httpStatus":null,"severity":"error","filePath":"src/ImageSharp/ColorProfiles/Icc/IccConverterbase.Conversions.cs","lineNumber":63,"sourceCode":"            ConversionMethod.A1 => toPcs ?\n                                InitA(profile, IccProfileTag.AToB1) :\n                                InitA(profile, IccProfileTag.BToA1),\n            ConversionMethod.A2 => toPcs ?\n                                InitA(profile, IccProfileTag.AToB2) :\n                                InitA(profile, IccProfileTag.BToA2),\n            ConversionMethod.ColorTrc => InitColorTrc(profile, toPcs),\n            ConversionMethod.GrayTrc => InitGrayTrc(profile, toPcs),\n            _ => throw new InvalidIccProfileException(\"Invalid conversion method.\"),\n        };\n\n    private static IVector4Calculator InitA(IccProfile profile, IccProfileTag tag)\n        => GetTag(profile, tag) switch\n        {\n            IccLut8TagDataEntry lut8 => new LutEntryCalculator(lut8),\n            IccLut16TagDataEntry lut16 => new LutEntryCalculator(lut16),\n            IccLutAToBTagDataEntry lutAtoB => new LutABCalculator(lutAtoB),\n            IccLutBToATagDataEntry lutBtoA => new LutABCalculator(lutBtoA),\n            _ => throw new InvalidIccProfileException($\"Invalid entry {tag}.\"),\n        };\n\n    private static IVector4Calculator InitD(IccProfile profile, IccProfileTag tag)\n    {\n        IccMultiProcessElementsTagDataEntry entry = GetTag<IccMultiProcessElementsTagDataEntry>(profile, tag)\n            ?? throw new InvalidIccProfileException(\"Entry is null.\");\n\n        throw new NotImplementedException(\"Multi process elements are not supported\");\n    }\n\n    private static ColorTrcCalculator InitColorTrc(IccProfile profile, bool toPcs)\n    {\n        IccXyzTagDataEntry redMatrixColumn = GetTag<IccXyzTagDataEntry>(profile, IccProfileTag.RedMatrixColumn);\n        IccXyzTagDataEntry greenMatrixColumn = GetTag<IccXyzTagDataEntry>(profile, IccProfileTag.GreenMatrixColumn);\n        IccXyzTagDataEntry blueMatrixColumn = GetTag<IccXyzTagDataEntry>(profile, IccProfileTag.BlueMatrixColumn);\n\n        IccTagDataEntry redTrc = GetTag(profile, IccProfileTag.RedTrc);\n        IccTagDataEntry greenTrc = GetTag(profile, IccProfileTag.GreenTrc);","sourceCodeStart":45,"sourceCodeEnd":81,"githubUrl":"https://github.com/SixLabors/ImageSharp/blob/59ce6af6fc29027cda277ef62d4d1694a8acce91/src/ImageSharp/ColorProfiles/Icc/IccConverterbase.Conversions.cs#L45-L81","documentation":"Thrown by IccConverterBase.InitA when the ICC profile's A-to-B tag exists but its TagDataEntry is not one of the supported LUT types (lut8, lut16, lutAtoB, lutBtoA). ImageSharp cannot build the color conversion pipeline from this entry, so the profile is declared invalid.","triggerScenarios":"Calling an IccConverter/Init conversion for a profile whose A2B0/A2B1 (or B2A) tag contains a data entry of an unexpected type (e.g. a multiProcessElements or textDescription entry where a LUT entry is required).","commonSituations":"Loading malformed or non-conformant ICC profiles produced by third-party tools; profiles using the multiProcessElements A2B encoding (v5 perceptual intent), which is not yet implemented in the LUT path.","solutions":["Re-encode the ICC profile with standard lut16/lutAtoB A2B entries (e.g. re-export it with a color management tool such as littleCMS icc2icc or Photoshop).","Use a different ICC profile version (v2/v4 matrix or LUT-based) instead of a v5 multiProcessElements one.","Catch InvalidIccProfileException and fall back to a built-in/default profile."],"exampleFix":"// before: using a v5 ICC profile with multiProcessElements A2B\nvar converter = new IccConverter(loadedV5Profile);\n// after: convert the profile to a v4 LUT-based one first\n// $ lcms: transicc / icc2ps to regenerate A2B0 as lut16\nvar converter = new IccConverter(loadV4Profile(\"device-v4.icc\"));","handlingStrategy":"try-catch","validationCode":"bool a2bSupported = profile.Tags.TryGetValue(IccProfileTag.A2B0, out var e)\n    && e is IccLut8TagDataEntry or IccLut16TagDataEntry or IccLutAToBTagDataEntry or IccLutBToATagDataEntry;\nif (!a2bSupported) { /* use a fallback profile */ }","typeGuard":"static bool IsSupportedLutEntry(IccTagDataEntry e) =>\n    e is IccLut8TagDataEntry or IccLut16TagDataEntry or IccLutAToBTagDataEntry or IccLutBToATagDataEntry;","tryCatchPattern":"try { var conv = new IccConverter(profile); }\ncatch (InvalidIccProfileException ex) { logger.LogWarning(ex, \"Unsupported ICC LUT entry\"); conv = new IccConverter(KnownIccProfiles.SRgb); }","preventionTips":["Prefer v2/v4 matrix or LUT ICC profiles from trusted sources.","Inspect profile tag entry types before building converters.","Pin known-good profiles (sRGB etc.) in your app for fallback."],"tags":["icc","color-profile","lut","image-processing"],"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"}