Color profile name mangling

Bug #1457105 reported by houz on 2015-05-20
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Medium
houz

Bug Description

If the name of a color profile starts with a number it is change to start with a dash (src/ui/dialog/document-properties.cpp:sanitizeName()). According to the comment that goes with that function names may only begin with ':', 'A'-'Z', '_', 'a'-'z' so the use of '-' is ill advised. HOWEVER, even when changing the '-' to a '_' in the XML editor the profile can't be used in the Fill&Stroke dialog (this might be related to some other bug reports).

I would advise to use '_' instead of '-' and look for the cause of it not working elsewhere.

I attached a sample profile.

houz (houz) wrote :
su_v (suv-lp) wrote :

Reproduced with Inkscape 0.48.5, 0.91 r13725 and 0.91+devel r14163 on OS X 10.7.5.

The profile with the mangled name not being usable in 'Fill and Stroke' affects mostly trunk (0.48.x and 0.91 at least initially select the profile and show the full set of sliders) seems to be related to the recent merge in r14160.

Changed in inkscape:
importance: Undecided → Medium
status: New → Confirmed
tags: added: color
houz (houz) wrote :

Thinking about this a little longer I came to the conclusion that replacing the first character might not be the best idea. If the only unique part of the name that differentiates some profiles is a digit in the first place of the name (unlikely, but still) you would end up with a bunch of identical names. Instead I would prepend an underscore. Since the code in question had another problem (it wouldn't clean up names of length one) I attached a diff that does what I suggested.

jazzynico (jazzynico) on 2015-06-23
Changed in inkscape:
assignee: nobody → houz (houz)
status: Confirmed → In Progress
jazzynico (jazzynico) wrote :

Tested on Windows XP (32 bit) and Xubuntu 14.04 (64 bit) with Inkscape trunk rev.14225.

Unfortunately the profile attached comment #1 causes a crash when adding it to the document, patch applied or not (same error messages as in Bug #1457069 (ICC profile filename with [] causes a crash (rev >= 13107)).

jazzynico (jazzynico) wrote :

Patch from comment #3 tested successfully with a fixed profile (Removing the spaces in the profile name fixes the crash).
Thanks!

Changed in inkscape:
milestone: none → 0.92
Mc (mc...) wrote :

Committed in r14663

Changed in inkscape:
status: In Progress → Fix Committed
Bryce Harrington (bryce) on 2017-01-10
Changed in inkscape:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers