[Qt] Make it possible to disable libwebp and libjpeg-turbo at build time

Pull less dependencies.
This commit is contained in:
Thiago Marcos P. Santos
2016-05-05 18:10:03 +03:00
parent 10e522d10b
commit a818917714
5 changed files with 29 additions and 14 deletions

View File

@@ -153,12 +153,12 @@ std::string canonicalizeTileURL(const std::string& url, SourceType type, uint16_
auto tileset = url.substr(tilesetStartIdx, tilesetEndIdx - tilesetStartIdx);
auto extension = url.substr(extensionIdx + 1, queryIdx - extensionIdx - 1);
#if !defined(__ANDROID__) && !defined(__APPLE__)
#if !defined(__ANDROID__) && !defined(__APPLE__) && !defined(QT_IMAGE_DECODERS)
// Replace PNG with WebP.
if (extension == "png") {
extension = "webp";
}
#endif // !defined(__ANDROID__) && !defined(__APPLE__)
#endif // !defined(__ANDROID__) && !defined(__APPLE__) && !defined(QT_IMAGE_DECODERS)
std::string result = "mapbox://tiles/" + tileset + "/{z}/{x}/{y}";