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

bmp_file_header fields are incorrectly set on bmp export #3534

Closed
Arecher opened this issue Sep 23, 2022 · 5 comments · Fixed by #3535
Closed

bmp_file_header fields are incorrectly set on bmp export #3534

Arecher opened this issue Sep 23, 2022 · 5 comments · Fixed by #3535
Assignees
Labels
bug high priority persistence Issues about loading or saving files / persisting information on disk time-2
Milestone

Comments

@Arecher
Copy link

Arecher commented Sep 23, 2022

Aseprite and System version

  • Aseprite 1.3-beta21-x64
  • Windows 10

Thought I would make this a separate bug report. Contributors at the Godot Engine project have looked into the bmp files not properly importing, and found that something about the bmps is in fact incorrecly set.

The fields bmp_file_header.bmp_file_size and bmp_info_header.bmp_size_image are incorrectly set

Here is the specific post, seems like something that might need investigating further:
godotengine/godot#66238 (comment)

@Gasparoken
Copy link
Member

Thanks again. I'll review it ASAP.

@Gasparoken Gasparoken added bug high priority persistence Issues about loading or saving files / persisting information on disk time-2 labels Sep 23, 2022
@Gasparoken
Copy link
Member

Gasparoken commented Sep 23, 2022

I made a patch for this and saved test.bmp. Could you try this example on your Godot engine?
test.bmp.zip

The bad calculation of bmp image size (biSizeImage) is done here:

else {
biSizeImage = (w*3 + filler) * h;
if (withAlpha)

biSizeImage was calculated based on the old 24 bits (3 bytes). But now, if the BMP is inferred to have alpha content, the file will be 32 bpp (4 bytes per pixel). I forgot to change it at bdcabde

It'll be fixed in the next release.

@Arecher
Copy link
Author

Arecher commented Sep 23, 2022

Yes, that test .bmp imports correctly into Godot!

@Gasparoken
Copy link
Member

Thank you for your feedback! Perhaps the new feature in #3532 is no longer needed. We'll review it next week.

@Arecher
Copy link
Author

Arecher commented Sep 23, 2022

This fix would resolve all my problems, so the new feature wouldn't be required anymore for my specific use-case. Unless there are apps that don't handle specific bmp files well, I think it could be closed. (After all, it can always be reopened if other users run into these apps!)

And thank you for all the effort you put in! ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug high priority persistence Issues about loading or saving files / persisting information on disk time-2
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants