Skip to content

Commit

Permalink
Integrate Version
Browse files Browse the repository at this point in the history
  • Loading branch information
tatarize committed Mar 5, 2021
1 parent 9cda285 commit a1c34b1
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
3 changes: 2 additions & 1 deletion pyembroidery/JefReader.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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 change: 0 additions & 1 deletion pyembroidery/JefWriter.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion pyembroidery/PecWriter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion test/test_encoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,4 @@ def test_transcode_to_self(self):
from pyembroidery.EmbEncoder import Transcoder
encoder = Transcoder()
encoder.transcode(pattern, pattern)
self.assertNotEquals(len(pattern.stitches), 0)
self.assertNotEqual(len(pattern.stitches), 0)

0 comments on commit a1c34b1

Please sign in to comment.