Add warning for tiles image format conversion

This commit is contained in:
GriffinR 2026-01-05 09:22:05 -05:00
parent 9c1435b9fa
commit af931c7f4d

View File

@ -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()) {