Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relax pixel width and height check to determine the ratio #22

Merged

Conversation

martinezjavier
Copy link
Contributor

The Aseprite File Format Specification says the following about the pixel width and pixel height fields:

BYTE Pixel width (pixel ratio is "pixel width/pixel height").
If this or pixel height field is zero, pixel ratio is 1:1
BYTE Pixel height

But the read_aseprite() function only considers a 1:1 pixel ratio if both width and height values are 1, and not when one of these has zero value.

There are some Aseprite editors (such as LibreSprite) that don't set these fields, even when only supports a 1:1 pixel ratio. But due read_aseprite() being that strict in checking the width and height, these Aseprite files can't be read and attempting to do so will fail with the following error:

UnsupportedFeature("Only pixel width:height ratio of 1:1 supported")

The Aseprite File Format Specification says the following about the pixel
width and pixel height fields:

  BYTE        Pixel width (pixel ratio is "pixel width/pixel height").
              If this or pixel height field is zero, pixel ratio is 1:1
  BYTE        Pixel height

But the read_aseprite() function only considers a 1:1 pixel ratio if both
width and height values are 1, and not when one of these has zero value.

There are some Aseprite editors (such as LibreSprite) that don't set these
fields, even when only supports a 1:1 pixel ratio. But due read_aseprite()
being that strict in checking the width and height, these Aseprite files
can't be read and attempting to do so will fail with the following error:

  UnsupportedFeature("Only pixel width:height ratio of 1:1 supported")
@martinezjavier martinezjavier changed the title Relax check for pixel wdith and height values to determine the ratio Relax pixel width and height check to determine the ratio Jan 23, 2024
@martinezjavier
Copy link
Contributor Author

@alpine-alpaca @B-Reif any comments on this ?

@B-Reif
Copy link
Contributor

B-Reif commented Feb 17, 2024

I’m not a maintainer of this repo, but if this is spec compliant then LGTM

@martinezjavier
Copy link
Contributor Author

I’m not a maintainer of this repo, but if this is spec compliant then LGTM

Thanks! It seems this repo is abandoned...

@alpine-alpaca alpine-alpaca merged commit fe1e0ea into alpine-alpaca:main Mar 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants