From 0b8e6a6a83c7cc090272e4246bf9ca39775d8aec Mon Sep 17 00:00:00 2001 From: vision Date: Fri, 13 Jun 2014 15:32:49 +0800 Subject: [PATCH] The filename should be converted to lower case before comparing. --- cocos/platform/ios/CCImage.mm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cocos/platform/ios/CCImage.mm b/cocos/platform/ios/CCImage.mm index 71ebce91a2..ab288f8f65 100644 --- a/cocos/platform/ios/CCImage.mm +++ b/cocos/platform/ios/CCImage.mm @@ -42,7 +42,9 @@ bool cocos2d::Image::saveToFile(const std::string& filename, bool isToRGB) bool saveToPNG = false; bool needToCopyPixels = false; - if (std::string::npos != filename.find(".png")) + std::string basename(filename); + std::transform(basename.begin(), basename.end(), basename.begin(), ::tolower); + if (std::string::npos != basename.find(".png")) { saveToPNG = true; }