Code Monkey home page Code Monkey logo

py_aseprite's People

Contributors

egnor avatar eiyeron avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

py_aseprite's Issues

Unable to load *.aseprite file saved with a recent version of Aseprite

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:

image

image

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

Publishing to Pip?

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).

Small error in README and a small request

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.