kopia lustrzana https://github.com/EmbroidePy/pyembroidery
Integrate Version
rodzic
9cda28598f
commit
a1c34b1203
|
@ -23,6 +23,7 @@ def read_jef_stitches(f, out, settings=None):
|
|||
out.move(x, y)
|
||||
continue
|
||||
if ctrl == 0x01:
|
||||
# PATCH: None means stop since it was color #0
|
||||
if out.threadlist[color_index] is None:
|
||||
out.stop(0, 0)
|
||||
del out.threadlist[color_index]
|
||||
|
@ -61,10 +62,10 @@ def read(f, out, settings=None):
|
|||
for i in range(0, count_colors):
|
||||
index = abs(read_int_32le(f))
|
||||
if index == 0:
|
||||
# Patch: If we have color 0. Go ahead and set that to None.
|
||||
out.threadlist.append(None)
|
||||
else:
|
||||
out.add_thread(jef_threads[index % len(jef_threads)])
|
||||
|
||||
print(out.threadlist)
|
||||
f.seek(stitch_offset, 0)
|
||||
read_jef_stitches(f, out, settings)
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import datetime
|
||||
|
||||
from .EmbConstant import *
|
||||
from .EmbThread import build_nonrepeat_palette
|
||||
from .EmbThreadJef import get_thread_set
|
||||
from .WriteHelper import write_int_8, write_int_32le, write_string_utf8
|
||||
|
||||
|
|
|
@ -60,7 +60,7 @@ def write_pec_header(pattern, f, threadlist):
|
|||
f.write(b"\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20")
|
||||
add_value = current_thread_count - 1
|
||||
color_index_list.insert(0, add_value)
|
||||
assert color_index_list[0]<255, 'to many color changes, ({0}) out of bounds (0, 255)'.format(len(color_index_list))
|
||||
assert color_index_list[0] < 255, 'too many color changes, ({0}) out of bounds (0, 255)'.format(len(color_index_list))
|
||||
f.write(bytes(bytearray(color_index_list)))
|
||||
else:
|
||||
f.write(b"\x20\x20\x20\x20\x64\x20\x00\x20\x00\x20\x20\x20\xFF")
|
||||
|
|
|
@ -110,4 +110,4 @@ class TestEmbpattern(unittest.TestCase):
|
|||
from pyembroidery.EmbEncoder import Transcoder
|
||||
encoder = Transcoder()
|
||||
encoder.transcode(pattern, pattern)
|
||||
self.assertNotEquals(len(pattern.stitches), 0)
|
||||
self.assertNotEqual(len(pattern.stitches), 0)
|
||||
|
|
Ładowanie…
Reference in New Issue