fix(color): debug messages when loading images in Lua script not shown as errors (#6464)

This commit is contained in:
philmoz
2025-07-25 09:53:56 +10:00
committed by GitHub
parent d721aa9653
commit 57ad924934
2 changed files with 6 additions and 7 deletions
@@ -111,7 +111,7 @@ BitmapBuffer *BitmapBuffer::loadBitmap(const char *filename, BitmapFormats fmt)
f_close(&imgFile);
if (!img) {
TRACE("loadBitmap(%s) failed: %s", filename, stbi_failure_reason());
TRACE_ERROR("loadBitmap(%s) failed: %s", filename, stbi_failure_reason());
return nullptr;
}
@@ -123,7 +123,7 @@ BitmapBuffer *BitmapBuffer::loadBitmap(const char *filename, BitmapFormats fmt)
BitmapBuffer *bmp = new BitmapBuffer(dst_fmt, w, h);
if (bmp == nullptr) {
TRACE("loadBitmap: malloc failed");
TRACE_ERROR("loadBitmap: malloc failed");
return nullptr;
}
@@ -192,7 +192,7 @@ static uint8_t *convert_bitmap(uint8_t *img, int w, int h, int n)
{
uint8_t *bmp = (uint8_t *)lv_mem_alloc(((n == 4) ? 3 : 2) * w * h);
if (bmp == nullptr) {
TRACE("convert_bitmap: lv_mem_alloc failed");
TRACE_ERROR("convert_bitmap: lv_mem_alloc failed");
return nullptr;
}
@@ -240,7 +240,7 @@ static lv_res_t decoder_open(lv_img_decoder_t *decoder,
f_close(&imgFile);
if (!img) {
TRACE("decoder_open(%s) failed: %s", fn, stbi_failure_reason());
TRACE_ERROR("decoder_open(%s) failed: %s", fn, stbi_failure_reason());
return LV_RES_INV;
}
+2 -3
View File
@@ -237,9 +237,8 @@ void StaticImage::setSource(std::string filename)
lv_img_set_src(image, fullpath.c_str());
if (!hasImage()) {
// Failed to load
TRACE("could not load image '%s'", filename.c_str());
lv_obj_del(image);
image = nullptr;
TRACE_ERROR("could not load image '%s'", filename.c_str());
clearSource();
}
setZoom();
} else {