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

Fix "Image height is zero" error when secondary tileset has zero unique tiles #72

Merged

Conversation

rayrobdod
Copy link
Contributor

@rayrobdod rayrobdod commented Dec 20, 2024

The easiest way to trigger this is to create a secondary tileset using the same top/middle/bottom images for both the primary and secondary tileset. Since the primary and secondary all use the same tiles, the secondary will have zero unique tiles.

Formerly, when porytiles would write a image representing zero tiles, porytiles would attempt to write a zero-height image, with an emphasis on "not read a zero-height image", which libpng would call out as an error and would cause compilation to fail.

With this change, the output image for a tileset with zero tiles will be padded with transparent tiles, to create an output image with a non-zero height that libpng will be willing to write.

Copy link
Owner

@grunt-lucas grunt-lucas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice find!

@grunt-lucas grunt-lucas merged commit 522bcaf into grunt-lucas:develop Dec 22, 2024
2 checks passed
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.

2 participants