Wrong checking of 3d file extension. If a STL file has extension in .stl, .STL, .Stl, etc in different cases, then the existing function fails in checking.
This piece of code is present in /vcglib/wrap/io_trimesh/import.h and /vcglib/wrap/io_trimesh/export.h
Existing code
.--------------------------
static bool FileExtension(std::string filename, std::string extension)
{
std::locale loc1 ;
std::use_facet<std::ctype\<char> > ( loc1 ).tolower(&filename.begin(),&filename.rbegin());
std::use_facet<std::ctype\<char> > ( loc1 ).tolower(&extension.begin(),&extension.rbegin());
std::string end=filename.substr(filename.length()-extension.length(),extension.length());
return end==extension;
}</std::ctype\<char></std::ctype\<char>
Updated Code
.-----------------------------
static bool FileExtension(std::string filename, std::string extension)
{
std::transform(filename.begin(), filename.end(), filename.begin(), ::tolower);
std::transform(extension.begin(), extension.end(), extension.begin(), ::tolower);
std::string end=filename.substr(filename.length()-extension.length(),extension.length());
return end==extension;
}
Please add this code in the next release.
Thanks,
Sarbeswar
Anonymous
Done. Thanks for the suggestion!
p.