summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2017-12-04cairo, svg: ignore empty blocksHEADmasterMax Kellermann2-0/+6
Fixes crash bug found with the afl fuzzer. Signed-off-by: Max Kellermann <max.kellermann@gmail.com>
2017-12-04cairo,svg: convert "while" to "for" (code simplification)Max Kellermann2-10/+2
Signed-off-by: Max Kellermann <max.kellermann@gmail.com>
2017-12-04pes: check the color index, fail if out of rangeMax Kellermann1-1/+7
Fixes crash when there are more than 256 blocks. Signed-off-by: Max Kellermann <max.kellermann@gmail.com>
2017-12-04pes: new_block() fails if undefined color is referencedMax Kellermann1-1/+6
Fixes crash when the file's color table is too short. Signed-off-by: Max Kellermann <max.kellermann@gmail.com>
2017-12-04pes: add missing new_block() error checkMax Kellermann1-0/+2
Signed-off-by: Max Kellermann <max.kellermann@gmail.com>
2012-01-19Mark the "big y displacement" case as a jumpstitch tooLinus Torvalds1-0/+1
Another case pointed out by Trever and missed in his first patch. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-01-19Fix jumpstitch outputTrever L. Adams3-5/+8
I noticed that your thumbnailer shows jump stitches yielding some ugly thread lines in some cases. I have attached a patch which solves this problem. Feel free to use it, modify it, whatever. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-12-02Simplify and fix block allocationLinus Torvalds3-15/+12
This was just totally broken. Since we used to re-alloc the pes blocks, we cannot maintain a list of them: the pointers change. So stop realloc'ing the blocks, and instead just realloc the stitch list. And simplify the list handling while at it. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-12-02Add thumbnailer entry for gnome3Linus Torvalds2-0/+4
gnome3 changed the rules for how thumbnailer applications work. For the better, but without any real documentation. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-03-22pesconvert: Fixed row init range in output_png().Torsten Scheck1-1/+1
This prevents a segfault for small embroidery patterns or large output dimensions. Even though output_png() is dead code, there is a slight chance, that someone lacks libcairo-dev while being offline. ;-) Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-01-13Add a 'density' argument for thread thicknessLinus Torvalds3-4/+11
I like the default thin thread effect, but using a density of 2.5 or so seems to be a bit more realistic on my test-case. Which may be more about the test-case than anything else, but whatever. So with this, you can do something like pesconvert -d 2.5 -s 512 Jan_heartsdelight.pes s512.png to generate a 512-pixel sized version of the Brother example file. Making the "thread" thicker also meant that the line join matters a lot more. A miter join (the cairo default) is not how thread works and makes it all look very jagged. So make it use a round join instead. The line cap could probably be a butt cap, but I set it to round too. I doubt anybody will see any difference, since thread ends aren't common. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-01-13Fix some trivial scaling problemsLinus Torvalds1-9/+11
I used to scale everything to be square. That was fine for testing, but not so great for actual use. This makes it all look better when the input isn't square. It also scales the width of the line properly. And in honor of this actually being useful (it's installed on Tove's machine now), let's sign off on it all. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-01-13Copy pesconvert to the system thumbnailerLinus Torvalds1-0/+1
Yeah, yeah, people who know how to do rpm's and autoconf think this is ugly. Whatever.
2010-01-13Teach pesconvert a few command line optionsLinus Torvalds3-9/+46
2010-01-13Add thumbnailer gnome gconftool-2 settingLinus Torvalds1-0/+4
.. not that the program actually conforms to the syntax I used, but whatever. Maybe I'll get to it next.
2010-01-13Add silly rule to teach the system about PES filesLinus Torvalds2-0/+12
XML? F*ck me with a ten-foot pole. But if I want the thumbnailer, I apparently need this.
2010-01-13Split out main() into its own fileLinus Torvalds4-47/+59
This leaves the actual pes-reading code in pes.c, and puts the conversion logic in main.c. I should add some argument parsing code so that it can specify exactly what/how to convert things.
2010-01-13Add a 'cairo' backend for outputLinus Torvalds4-3/+43
This is way better and simpler than the png one, since cairo can also write png's, but makes the line drawing and thin lines all very easy. This is still totally hardcoded, but it's starting to be useful! It outputs the result as "out.png"
2010-01-13Add stupid PNG supportLinus Torvalds3-4/+56
It's stupid because: - it's fixed to output 128x128 png images (think preview icons) - it doesn't actually draw lines, it just does them as dots at the endpoints but it does kind of work.
2010-01-13Initial PES conversionLinus Torvalds5-0/+400
Right now it just knows how to convert to SVG. Which isn't all that interesting, but the parsing logic comes from https://bugs.launchpad.net/inkscape/+bug/247463 which has a php script to do this, and it's all based on that.