eiyeron / py_aseprite Goto Github PK
View Code? Open in Web Editor NEWPython 3 Aseprite loader module
License: MIT License
Python 3 Aseprite loader module
License: MIT License
I am currently getting this error when trying to load an aseprite file saved using 1.3.6 (via the Steam beta option):
{'chunk_size': 22, 'chunk_type': 8199}
{'chunk_size': 106, 'chunk_type': 4}
{'chunk_size': 31, 'chunk_type': 8196}
{'chunk_size': 69, 'chunk_type': 8197}
Traceback (most recent call last):
File "C:\Users\Sophie\AppData\Roaming\Blender Foundation\Blender\4.0\scripts\addons\ase_uv_symmetrize\scratch.py", line 7, in <module>
ase = AsepriteFile(aseprite_file.read())
File "C:\Users\Sophie\AppData\Roaming\Blender Foundation\Blender\4.0\scripts\addons\ase_uv_symmetrize\aseprite\__init__.py", line 22, in __init__
self.header, self.frames = AsepriteFile.parse_data(data)
File "C:\Users\Sophie\AppData\Roaming\Blender Foundation\Blender\4.0\scripts\addons\ase_uv_symmetrize\aseprite\__init__.py", line 91, in parse_data
frame.chunks.append(found_chunk_type(data, data_offset))
File "C:\Users\Sophie\AppData\Roaming\Blender Foundation\Blender\4.0\scripts\addons\ase_uv_symmetrize\aseprite\chunks.py", line 163, in __init__
(
ValueError: too many values to unpack (expected 2)
With a print statement before the exception, I can see that the cel_struct
tuple value being handled here is (11, 22, -25480, 99, 1760)
. This corresponds to the drawn layer of the image being loaded here, which is 11 by 22 pixels. I'm not sure what the other three and apparently newly added tuple elements represent. But truncating the tuple to just the first 2 elements did not fix the issue.
When changing L161 of chunks.py
to this:
(
self.data['width'],
self.data['height']
) = cel_struct.unpack_from(data, cel_end_offset)[:2]
I instead got this error:
{'chunk_size': 22, 'chunk_type': 8199}
{'chunk_size': 106, 'chunk_type': 4}
{'chunk_size': 31, 'chunk_type': 8196}
{'chunk_size': 69, 'chunk_type': 8197}
Traceback (most recent call last):
File "C:\Users\Sophie\AppData\Roaming\Blender Foundation\Blender\4.0\scripts\addons\ase_uv_symmetrize\scratch.py", line 7, in <module>
ase = AsepriteFile(aseprite_file.read())
File "C:\Users\Sophie\AppData\Roaming\Blender Foundation\Blender\4.0\scripts\addons\ase_uv_symmetrize\aseprite\__init__.py", line 22, in __init__
self.header, self.frames = AsepriteFile.parse_data(data)
File "C:\Users\Sophie\AppData\Roaming\Blender Foundation\Blender\4.0\scripts\addons\ase_uv_symmetrize\aseprite\__init__.py", line 91, in parse_data
frame.chunks.append(found_chunk_type(data, data_offset))
File "C:\Users\Sophie\AppData\Roaming\Blender Foundation\Blender\4.0\scripts\addons\ase_uv_symmetrize\aseprite\chunks.py", line 167, in __init__
self.data['data'] = zlib.decompress(data[start_range:end_range])
zlib.error: Error -3 while decompressing data: incorrect header check
Aseprite version info:
An example of an aseprite image file that this is happening with (32x32, indexed color, single layer):
https://files.pineapplemachine.com/public/logs/2024-05-01-test.aseprite
Hey, I see you haven't really maintained this package in a while.
I've build a package that uses your work to import aseprite files to pygame, which I'd like to publish to pip.
However, since it depends on your code which has not been published I was wondering whether you would mind to maybe take the time to publish it or to give me permission to publish it in your place (with credit of course).
The example in the README.org has the following example:
from aseprite import AsepriteFile
with open('my_file.aseprite', r) as f:
parsed_file = AsepriteFile(f.read())
I think the second line should be:
with open('my_file.aseprite','rb') as f:
At least thats what i had to do to make it run and be able to read bytes from file.
Anyway, thanks for your work, saved me some time.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.