Fix Aco swatch name loading.
ClosedPublic

Authored by woltherav on Oct 23 2016, 4:38 PM.

Details

Summary

It seems that in aco palettes, version 2 can store the name, but for some reason, adobe engineers decided that we should first have the version 1 variation of the file, and after that paste the complete ersion 2 variation.

Furthermore, the swatch names are stored in utf-16 big endian.

This patch works around that, taking a bit of inspiration from how swatchbooker handles the issue.

Test Plan
  1. Load any modern aco file.
  2. Look whether krita can show you swatch names in the palette docker.

some awkwardness, the file string starts with a 00 then the length of the name, then the name, and finally 00, I wasn't quite sure how to read past this, so I just assigned that 00 to a dummy int.

Diff Detail

Repository
R37 Krita
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
woltherav updated this revision to Diff 7623.Oct 23 2016, 4:38 PM
woltherav retitled this revision from to Fix Aco swatch name loading..
woltherav updated this object.
woltherav edited the test plan for this revision. (Show Details)
woltherav added a reviewer: rempt.
woltherav set the repository for this revision to R37 Krita.
rempt accepted this revision.Oct 24 2016, 7:48 AM
rempt edited edge metadata.
rempt added inline comments.
libs/pigment/resources/KoColorSet.cpp
558

I guess we don't, we can just skip, as you're doing now. So let's remove the commented out code.

This revision is now accepted and ready to land.Oct 24 2016, 7:48 AM
This revision was automatically updated to reflect the committed changes.