From 050cf75050b710d199e35c0dd975f0c34f297d64 Mon Sep 17 00:00:00 2001 From: Rob Taglang Date: Wed, 4 Apr 2018 12:20:56 -0400 Subject: [PATCH 1/4] Fix png detection and strip period from extension for mime types --- GLTF/src/GLTFImage.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/GLTF/src/GLTFImage.cpp b/GLTF/src/GLTFImage.cpp index 56188213e..7e5e4a6c4 100644 --- a/GLTF/src/GLTFImage.cpp +++ b/GLTF/src/GLTFImage.cpp @@ -14,8 +14,8 @@ GLTF::Image::Image(std::string uri, std::string cacheKey) : uri(uri), cacheKey(c GLTF::Image::Image(std::string uri) : Image(uri, "") {} GLTF::Image::Image(std::string uri, std::string cacheKey, unsigned char* data, size_t byteLength, std::string fileExtension) : uri(uri), data(data), byteLength(byteLength), cacheKey(cacheKey) { - std::string dataSubstring((char*)data, 9); - if (dataSubstring.substr(1, 8) == "PNG\r\n\x1a\n") { + std::string dataSubstring((char*)data, 8); + if (dataSubstring.substr(1, 7) == "PNG\r\n\x1a\n") { mimeType = "image/png"; } else if (data[0] == 255 && data[1] == 216) { @@ -41,6 +41,7 @@ GLTF::Image* GLTF::Image::load(path imagePath) { return imageCacheIt->second; } std::string fileExtension = imagePath.extension().string(); + fileExtension.erase(0, 1); GLTF::Image* image = NULL; FILE* file = fopen(fileString.c_str(), "rb"); if (file == NULL) { From 7b50e71fb3bca08529f314c996751366b493fcff Mon Sep 17 00:00:00 2001 From: Rob Taglang Date: Wed, 4 Apr 2018 12:22:41 -0400 Subject: [PATCH 2/4] Updated CHANGES.md --- CHANGES.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index cbf2f67ae..d25044815 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,7 +1,10 @@ Change Log ========== -### Next Release +### v2.1.1 - 2018-04-04 + +##### Fixes :wrench: +* Fixes issue where incorrect mime types were being generated [#162](https://github.com/KhronosGroup/COLLADA2GLTF/pull/164) ##### Additions :tada: * Add support for exporting double sided materials [#133](https://github.com/KhronosGroup/COLLADA2GLTF/pull/133) From 4d966b0bf60adc41f3e7e0837fdc09ff9a1e6b7e Mon Sep 17 00:00:00 2001 From: Rob Taglang Date: Wed, 4 Apr 2018 12:23:24 -0400 Subject: [PATCH 3/4] Fix ordering in CHANGES.md --- CHANGES.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index d25044815..088b24d34 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,12 +3,12 @@ Change Log ### v2.1.1 - 2018-04-04 -##### Fixes :wrench: -* Fixes issue where incorrect mime types were being generated [#162](https://github.com/KhronosGroup/COLLADA2GLTF/pull/164) - ##### Additions :tada: * Add support for exporting double sided materials [#133](https://github.com/KhronosGroup/COLLADA2GLTF/pull/133) +##### Fixes :wrench: +* Fixes issue where incorrect mime types were being generated [#162](https://github.com/KhronosGroup/COLLADA2GLTF/pull/164) + ### v2.1.0 - 2018-03-15 ##### Additions :tada: From 5558e249d4b195f3703138aac4a75ecf81057857 Mon Sep 17 00:00:00 2001 From: Rob Taglang Date: Wed, 4 Apr 2018 12:24:03 -0400 Subject: [PATCH 4/4] Tweak --- CHANGES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 088b24d34..4ce6565b7 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -7,7 +7,7 @@ Change Log * Add support for exporting double sided materials [#133](https://github.com/KhronosGroup/COLLADA2GLTF/pull/133) ##### Fixes :wrench: -* Fixes issue where incorrect mime types were being generated [#162](https://github.com/KhronosGroup/COLLADA2GLTF/pull/164) +* Fixed issue where incorrect mime types were being generated [#162](https://github.com/KhronosGroup/COLLADA2GLTF/pull/164) ### v2.1.0 - 2018-03-15