Skip to content

Error when loading View LUTs depending on locale setting #379

@Animtim

Description

@Animtim

I found this bug in Krita when trying to load any profile for "View" return an error:
https://bugs.kde.org/show_bug.cgi?id=338357

After a long investigation with dmitryK, it appears to happen just because my system locale is French (and so probably because we use comma as decimal separator..).
If I run "LANG=en krita" (or change main system locale to english), the bug doesn't happen anymore.

Exactly, it appears that in FileFormatSpi1D.cpp (and most probably others) 'if(sscanf(lineBuffer, "From %f %f", &from_min, &from_max)!=2)' takes system locale into consideration and cannot load the files written in C locale (e.g. srgb lut table).
Looks like sscanf is to blame.

Please fix it when you can...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions