-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Deprecate the BMP texture file format #13918
Comments
Worth noting that the Irrlicht built-in font is a BMP image, but this can be solved by just converting it into a PNG image and embedding it into the header (see Voxelmanip-Classic/irrlicht-vmc@7a96c42). |
I'm normally very sensitive when it comes to breaking backwards-compability but ... BMP support? Yeah, good riddance. I will not shed a single tear for BMP. Any mod depending on it really had it coming anyway. I wasn't even aware BMP is supported anyway. And if this helps freeing up valuable developer time for more important things, I'm all for it. |
@ch98-1 @dgm3333 @kaeza @HybridDog @bobombolo @eidy does any one of you rely in their code on the ability of the Minetest engine to display BMP images? I looked a bit at what your mods do and it seems that this is not the case. But I might be wrong, so a confirmation from the authors that there is no breakage if BMP is removed would be great. @rollerozxa embedding a binary into a header file looks like a source code crime. Why not load it from a file at build time? @Wuzzy2 I understand that you might not miss BMP, but others might (I will not though) and if removing BMP creates issues for them is what I am trying to find out with this issue. People are often not aware of features that they do not use, so “I do not know this was even supported” is rarely a good justification for removal or just deprecation, Not having any users who rely on a feature though, may be a good justification – the Linux kernel for example may remove support for some old WLAN hardware soon, with a stated plan to add in back any driver that even one user complains about being missing (as it means they have/use the hardware). Edit: I do not know if you meant “Any mod depending on it really had it coming anyway.” as a dark joke (like this broadway version of “Cell Block Tango” does), but that one in particular seems like victim-blaming to me. Using a feature of a software that has worked for years is not “having it coming”, regardless of how shitty that feature looks. Regarding the valuable developer time, I doubt that texture loading code is a big maintenance burden in normal development. It does, however, constitute attack surface and therefore should be minimized or removed and made as good as possible: Deleted code is debugged code. |
On ContentDB, the only two packages containing .bmp files are minetest_life and juanchi - both of which are unpublished |
For reference, there are nine published packages that contain tga files: refi_textures, mineclone2, xmaps, tga_encoder, mineclonia, naturalslopes_minetest_game, painting, wac, petz (not including devtest) |
I don't think there is a problem replacing the build-in font with a png. It's a header file, because there is no build-system independent way to load resource files in c++. And the main reason why that specific font is still used in Irrlicht is that it contains some icons for GUI elements (I think for checkboxes and scrollbars, maybe more). |
About
|
To elaborate, at least the following packages write TGA bitmaps at runtime (engine support means those can be displayed):
Amusingly, the map mods that write TGAs are exactly the opposite from the way BMP has been used in Minetest mods (making bitmaps from nodes vs making nodes from bitmaps). @rubenwardy given that both |
I searched for file names containing bmp/tga, it won't find dynamic uses |
I made a search for just "bmp" in code of packages on ContentDB: https://content.minetest.net/zipgrep/2784bb41-d88b-46e7-9d27-641dd3b9abb3/ (archived link) Only results appear to be for lists of valid texture filename extensions, mostly originating from modlib. Edit: Here are also the zipgrep results för "BMP" (archive) and "bitmap" (archive) too, though mostly seems to be false positives apart from a function that can read the resolution of a BMP image (in addition to a number of other formats, some of which we don't support either) |
@appgurueu @Zughy @gabri-viane your |
We really don't have to go and ping every mod author on GH and ask them if they are fine with it. |
@sfan5 my rationale here is that as supporting BMP is possibly security-relevant (did you fuzz the Irrlicht BMP loader too by any chance?), I would like it to be removed as soon as possible (if possible at all). If nothing is broken by removing BMP (which seems to be the case, but I am not done with the research yet), ”as soon as possible” might be ”as soon as the next security vulnerability is found in the loader” or maybe even earlier. |
Go with it, never touched a .bmp on Minetest (unsubscribing) |
Yes,
Feel free to go ahead with deprecating / removing BMP. |
minetest-imageloader uses its own BMP decoder, so we can ignore it for this issue. I also want to get rid of BMP developed by Microsoft Corporation. |
Done by #13922. |
Problem
I am unaware of any usage of BMP in Minetest besides
builtInFont.bmp
in IrrlichtMT.Therefore, I want to discuss here removing the support for BMP from Minetest.
Rationale: Where any input is processed we have an opportunity for security bugs.
The recent fuzzing of the TGA decoder has revealed several bugs, that have since been fixed thanks to the quick response of Irrlicht upstream. Bugs are not unique to Irrlicht's handling of the TGA file format though: libpng has a long list of vulnerabilities, libjpeg turbo has vulnerabilities and libwebp was so bad that one could exploit many applications by loading a single image file.
The IrrlichtMT BMP decoder code is larger than the TGA decoder code and from a cursory look seems less useful than all other texture formats that Minetest uses (JPEG, PNG, TGA), for any purpose:
I am not 100% sure about this assessment: The BMP decoder seems to support 1bpp bitmaps, which might make it useful for storing black-white textures in a lower amount of space than other formats – but I also doubt that such things are important for Minetest if BMP is indeed not used in mods, games or texture packs.
Solutions
I propose the following plan:
a) ContentDB
b) Minetest forums
c) GitHub, GitLab, MeseHub, Codeberg and other forge sites.
If not one mod can be found that uses BMP in a way that the engine must support it, remove it soon. Otherwise do this:
Alternatives
Additional context
Mods on ContentDB that contain the string
bmp
– probably no engine support necessary@rollerozxa did a ContentDB zipgrep searches:
This yielded:
modlib
code that uses file endings to collect all media in a mod in:nonsensical_skyblock
modlib
spiraling_down
survivetest
arena_lib
code that finds unused JPEG, PNG, BMP (but not TGA) filesminebase_core
can determine image dimensions for several image formats, among them BMPMods on ContentDB that contain BMP files – so far all have been unpublished
juanchi
from @runsy (status unclear)./mods/pipeworks/textures/New Bitmap Image.bmp
but that file was deleted in 2016Mods that read BMP files to place nodes in the world – probably no engine support necessary
minetest-imageloader
to put a comic girl in a Minetest world. (2014)minetest-imageloader
to put a photo of a person in a Minetest world (2015).minetest-imageloader
to a photo of Donald Trump in a Minetest world (2017)minetest-imageloader
to help building Angkor Wat in Minetest (2015)The text was updated successfully, but these errors were encountered: