hack to import GIMP palette

very instructive indeed, thanks!

and about triming a string… i guess doing it per character from the left and right ends seems the most obvious, and using Regular Expression seems the most elegant, to me. don’t know which is the most efficient though, and I’m quite astonished there seems to be no such standard method in C++. Maybe in the “boost” lib?

Thanks again, and ok, I’ll try set up an environment that can build Synfig, but I didn’t succeed up to now and would hate to give you guys other not-event-compiled-and-for-sure-untested patches… even if this one seemed easy and safe enough to risk.

Berteh.

In C++ there are other higher level functions like find_first_of or find_last_not_of, which we could use to implement trim. The STL is very general. the exact trim function is indeed in boost strings library but it’s just a small function so I wouldn’t add the dependency to synfig just for this.
There is a very simple and clean solution: put the string into a stringstream, extract every word from the stream and concatenate them with spaces into a new line.

About the environment, if you are in GNU/Linux, the script in the autobuild folder should install the needed dependencies for you, and if not, just executing the script from the Dev:Build_instructions article in the wiki manually sentence by sentence should give you enough information on the packages that you are missing.

But don’t let, in any case, the not not-having-environment or not exact C++ compilance prevent you from writting patches like this. Any of us would be happy to adapt your patch and apply it.

EDIT: I have improved the GPL format support (which I had to infere since I haven’t found any format specification) and fixed some bugs because the GPL format is a little more free than we supposed from the description from Inkscape website. Now it works perfectly for every possible well-formed GIMP/Inkscape palette.