#31555 (Bug) parametricCurveType values should be clipped

+1 0

Component: DisplayCAL
Created by dogelition

Last modified

From the ICC v4.3 specification, section 10.16 parametricCurveType:

The domain and range of each function shall be [0,0 1,0]. Any function value outside the range shall be
clipped to the range of the function.

The corresponding code in DisplayCAL (function apply in class ParametricCurveType in file ICCProfile.py) does not apply clipping. This can cause issues with real in-the-wild ICC profiles. For example, I encountered a profile that could not be viewed in the Profile information window due to the final calculated curve value being slightly above 1, which resulted in an error window saying struct.error: 'H' format requires 0 <= number <= 65535 (not sure if I can share the profile here, due to copyright). Changing the code to clip the curve values fixed the error.

Leave a Reply