From b3a5fc1bda93fd9ebbf32f97ed12fd263c3f56d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20B=C3=A6rentzen?= Date: Wed, 6 May 2026 13:20:01 +0200 Subject: [PATCH] Added code path for TGA loading of 8 bit bw images --- src/LibSL/Image/ImageFormat_TGA.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/LibSL/Image/ImageFormat_TGA.cpp b/src/LibSL/Image/ImageFormat_TGA.cpp index 686c521..fe7017e 100755 --- a/src/LibSL/Image/ImageFormat_TGA.cpp +++ b/src/LibSL/Image/ImageFormat_TGA.cpp @@ -103,6 +103,11 @@ NAMESPACE::Image *NAMESPACE::ImageFormat_TGA::load(const char *name) const img = rgba; // read pixels memcpy(rgba->pixels().raw(),tga->pixels,w*h*4); + } else if (tga->depth == 8) { + // create image + ImageL8 *lum = new ImageL8(w,h); + img = lum; + memcpy(lum->pixels().raw(),tga->pixels,w*h*1); } else { throw Fatal("ImageFormat_TGA::load - Sorry, unknown tga format (file '%s')",name); }