Skip to content

Commit

Permalink
Save as bitmaps as PNG if format cannot be deduced from filename
Browse files Browse the repository at this point in the history
  • Loading branch information
ahojnnes committed Oct 8, 2017
1 parent 876d06f commit 4d96c9f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/util/bitmap.cc
Expand Up @@ -434,6 +434,10 @@ bool Bitmap::Write(const std::string& path, const FREE_IMAGE_FORMAT format,
FREE_IMAGE_FORMAT save_format;
if (format == FIF_UNKNOWN) {
save_format = FreeImage_GetFIFFromFilename(path.c_str());
if (save_format == FIF_UNKNOWN) {
// If format could not be deduced, save as PNG by default.
save_format = FIF_PNG;
}
} else {
save_format = format;
}
Expand Down

0 comments on commit 4d96c9f

Please sign in to comment.