From 03ba9370b951f1c0904b53dfac3f5daf0bb354d6 Mon Sep 17 00:00:00 2001 From: sfan5 Date: Wed, 25 Oct 2023 17:18:34 +0200 Subject: [PATCH] Deprecate .bmp format --- doc/lua_api.md | 2 +- src/server.cpp | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/doc/lua_api.md b/doc/lua_api.md index 9e910f400..af8656f65 100644 --- a/doc/lua_api.md +++ b/doc/lua_api.md @@ -265,7 +265,7 @@ the clients (see [Translations]). Accepted characters for names are: Accepted formats are: - images: .png, .jpg, .bmp, .tga + images: .png, .jpg, .tga, (deprecated:) .bmp sounds: .ogg vorbis models: .x, .b3d, .obj diff --git a/src/server.cpp b/src/server.cpp index a9c4c10b3..07f15b3f0 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -2557,6 +2557,13 @@ bool Server::addMediaFile(const std::string &filename, return false; } + const char *deprecated_ext[] = { ".bmp", nullptr }; + if (!removeStringEnd(filename, deprecated_ext).empty()) + { + warningstream << "Media file \"" << filename << "\" is using a" + " deprecated format and will stop working in the future." << std::endl; + } + SHA1 sha1; sha1.addBytes(filedata.c_str(), filedata.length());