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 loader fails to import images #30629

Closed
Tracked by #39196
Calinou opened this issue Jul 16, 2019 · 1 comment · Fixed by #41352
Closed
Tracked by #39196

BMP loader fails to import images #30629

Calinou opened this issue Jul 16, 2019 · 1 comment · Fixed by #41352

Comments

@Calinou
Copy link
Member

Calinou commented Jul 16, 2019

Godot version: Git 22c843b

OS/device including version: Fedora 30, GIMP 2.10.12, ImageMagick 6.9.10 (used for BMP conversion)

Issue description: The BMP loader fails to load images saved from GIMP and ImageMagick:

image

Unsupported bmp file: res://icon_from_gimp_16bit.bmp
core/io/image_loader.cpp:69 - Error loading image: res://icon_from_gimp_16bit.bmp
editor/editor_file_system.cpp:1786 - Error importing: res://icon_from_gimp_16bit.bmp
modules/bmp/image_loader_bmp.cpp:261 - Condition ' color_table_size == 0 ' is true. returned: ERR_BUG
core/io/image_loader.cpp:69 - Error loading image: res://icon_from_gimp_24bit.bmp
editor/editor_file_system.cpp:1786 - Error importing: res://icon_from_gimp_24bit.bmp
Unsupported bmp file: res://icon_from_gimp_32bit.bmp
core/io/image_loader.cpp:69 - Error loading image: res://icon_from_gimp_32bit.bmp
editor/editor_file_system.cpp:1786 - Error importing: res://icon_from_gimp_32bit.bmp
Unsupported bmp file: res://icon_from_imagemagick.bmp
core/io/image_loader.cpp:69 - Error loading image: res://icon_from_imagemagick.bmp
editor/editor_file_system.cpp:1786 - Error importing: res://icon_from_imagemagick.bmp

The exact file formats as described by the file command are:

icon_from_gimp_16bit.bmp:  PC bitmap, Windows 98/2000 and newer format, 64 x 64 x 16
icon_from_gimp_24bit.bmp:  PC bitmap, Windows 95/NT4 and newer format, 64 x 64 x 24
icon_from_gimp_32bit.bmp:  PC bitmap, Windows 98/2000 and newer format, 64 x 64 x 32
icon_from_imagemagick.bmp: PC bitmap, Windows 98/2000 and newer format, 64 x 64 x 32

Steps to reproduce: Load a BMP file and try to use it as a Sprite texture.

Minimal reproduction project: test_image_formats.zip

@Xrayez
Copy link
Contributor

Xrayez commented Jul 16, 2019

Managed to fix importing icon_from_gimp_24bit.bmp in linked PR, for other types it seems like the loader is complaining about not supported compression type:

// Compressed bitmaps not supported, stop parsing
if (bmp_header.bmp_info_header.bmp_compression != BI_RGB) {
ERR_EXPLAIN("Unsupported bmp file: " + f->get_path());
f->close();
ERR_FAIL_V(ERR_UNAVAILABLE);
}

Even if these get resolved, 16-bit is also not supported by the loader.

Calinou added a commit to Calinou/godot that referenced this issue Aug 18, 2020
@akien-mga akien-mga added this to the 4.0 milestone Aug 18, 2020
akien-mga pushed a commit that referenced this issue Aug 21, 2020
This closes #32166 and closes #30629.

(cherry picked from commit 40485e2)
MarcusElg pushed a commit to MarcusElg/godot that referenced this issue Oct 19, 2020
huhund pushed a commit to huhund/godot that referenced this issue Nov 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants