kopia lustrzana https://github.com/EmbroidePy/pyembroidery
rodzic
10e8d68df7
commit
0e8519ed48
|
@ -30,7 +30,7 @@ def write(pattern, f, settings=None):
|
|||
date_string = settings.get("date", date_string)
|
||||
|
||||
pattern.fix_color_count()
|
||||
color_count = pattern.count_threads()
|
||||
color_count = pattern.count_color_changes()
|
||||
offsets = 0x74 + (color_count * 8)
|
||||
write_int_32le(f, offsets)
|
||||
write_int_32le(f, 0x14)
|
||||
|
|
|
@ -6,6 +6,7 @@ from .EmbFunctions import *
|
|||
from .EmbMatrix import EmbMatrix
|
||||
from .EmbPattern import EmbPattern
|
||||
from .EmbThread import EmbThread
|
||||
from .EmbCompress import EmbCompress
|
||||
|
||||
# items available in a sub-heirarchy (e.g. pyembroidery.PecGraphics.get_graphic_as_string)
|
||||
from .PecGraphics import get_graphic_as_string
|
||||
|
|
|
@ -3,7 +3,7 @@ from __future__ import print_function
|
|||
import random
|
||||
import unittest
|
||||
|
||||
from EmbCompress import expand, compress
|
||||
from pyembroidery import *
|
||||
|
||||
|
||||
class TestReadHus(unittest.TestCase):
|
||||
|
@ -12,6 +12,6 @@ class TestReadHus(unittest.TestCase):
|
|||
for i in range(10):
|
||||
s = random.randint(10, 1000)
|
||||
test_bytes = bytearray(random.getrandbits(8) for _ in range(s))
|
||||
compressed_bytes = compress(test_bytes)
|
||||
uncompressed = bytearray(expand(compressed_bytes, len(test_bytes)))
|
||||
compressed_bytes = EmbCompress.compress(test_bytes)
|
||||
uncompressed = bytearray(EmbCompress.expand(compressed_bytes, len(test_bytes)))
|
||||
self.assertEqual(test_bytes, uncompressed)
|
||||
|
|
Ładowanie…
Reference in New Issue