Add support to load sprites without extension (identified only by their content)

This commit is contained in:
David Capello 2020-08-03 17:31:14 -03:00
parent cd21d33fe7
commit 1470108fff

View File

@ -1,5 +1,5 @@
// Aseprite
// Copyright (C) 2019 Igara Studio S.A.
// Copyright (C) 2019-2020 Igara Studio S.A.
// Copyright (C) 2001-2018 David Capello
//
// This program is distributed under the terms of
@ -642,9 +642,10 @@ again:
}
#endif
// does it not have extension? ...we should add the extension
// Does it not have extension? ...we should add the extension
// selected in the filetype combo-box
if (!buf.empty() && base::get_file_extension(buf).empty()) {
if (m_type == FileSelectorType::Save &&
!buf.empty() && base::get_file_extension(buf).empty()) {
buf += '.';
buf += getSelectedExtension();
}