Skip to content

Commit

Permalink
tmxrasterizer: Default to 'png' when target format not recognized
Browse files Browse the repository at this point in the history
Normally the format is derived from the file name, but that doesn't work
for the temporary files used when tmxrasterizer is called as
thumbnailer.
  • Loading branch information
bjorn committed Sep 26, 2016
1 parent 4b09154 commit 29274e4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/tmxrasterizer/tmxrasterizer.cpp
Expand Up @@ -159,6 +159,10 @@ int TmxRasterizer::render(const QString &mapFileName,

// Save image
QImageWriter imageWriter(imageFileName);

if (!imageWriter.canWrite())
imageWriter.setFormat("png");

if (!imageWriter.write(image)) {
qWarning().nospace() << "Error while writing " << imageFileName << ": "
<< qPrintable(imageWriter.errorString());
Expand Down

0 comments on commit 29274e4

Please sign in to comment.