From af931c7f4de28c8379c5d2c1de5fd4f2ab2b4640 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Mon, 5 Jan 2026 09:22:05 -0500 Subject: [PATCH] Add warning for tiles image format conversion --- src/core/tileset.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/core/tileset.cpp b/src/core/tileset.cpp index 0aa1f7d6..34868cbe 100644 --- a/src/core/tileset.cpp +++ b/src/core/tileset.cpp @@ -563,7 +563,11 @@ bool Tileset::loadTilesImage(QImage *importedImage) { imported = true; } else if (QFile::exists(this->tilesImagePath)) { // No image provided, load from file path. - image = QImage(this->tilesImagePath).convertToFormat(QImage::Format_Indexed8, Qt::ThresholdDither); + image = QImage(this->tilesImagePath); + if (!image.isNull() && image.format() != QImage::Format_Indexed8) { + logWarn(QString("Tiles image '%1' is not indexed. Converting to indexed format.").arg(this->tilesImagePath)); + image.convertTo(QImage::Format_Indexed8, Qt::ThresholdDither); + } } if (image.isNull()) {