diff options
author | yanchen036 <yanchen036@gmail.com> | 2017-01-02 13:33:49 +0800 |
---|---|---|
committer | yanchen036 <yanchen036@gmail.com> | 2018-02-15 15:21:45 +0800 |
commit | b3deb95e75f6890c08e7aa60193ea304614b24ea (patch) | |
tree | a6007f02726ede2ff8208593394823484a9addc6 /src/caffe/util/io.cpp | |
parent | a44c444ee4ae0e7c0aa77118213d34bb26e9f2e6 (diff) | |
download | caffe-b3deb95e75f6890c08e7aa60193ea304614b24ea.tar.gz caffe-b3deb95e75f6890c08e7aa60193ea304614b24ea.tar.bz2 caffe-b3deb95e75f6890c08e7aa60193ea304614b24ea.zip |
bug fix: ext should not include the '.'
Diffstat (limited to 'src/caffe/util/io.cpp')
-rw-r--r-- | src/caffe/util/io.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/caffe/util/io.cpp b/src/caffe/util/io.cpp index 835d2d4e..5295d9dd 100644 --- a/src/caffe/util/io.cpp +++ b/src/caffe/util/io.cpp @@ -106,7 +106,7 @@ cv::Mat ReadImageToCVMat(const string& filename) { static bool matchExt(const std::string & fn, std::string en) { size_t p = fn.rfind('.'); - std::string ext = p != fn.npos ? fn.substr(p) : fn; + std::string ext = p != fn.npos ? fn.substr(p+1) : fn; std::transform(ext.begin(), ext.end(), ext.begin(), ::tolower); std::transform(en.begin(), en.end(), en.begin(), ::tolower); if ( ext == en ) |