From b46be04fc6659e5df787359b5dfbffbe2e2ffac7 Mon Sep 17 00:00:00 2001 From: Kangning Li Date: Thu, 7 Jun 2018 15:00:21 -0400 Subject: [PATCH 1/3] load greyscale images as luminance instead of alpha --- lib/loadImage.js | 2 +- specs/lib/loadImageSpec.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/loadImage.js b/lib/loadImage.js index c238a27..b9b4fda 100644 --- a/lib/loadImage.js +++ b/lib/loadImage.js @@ -96,7 +96,7 @@ function getChannels(colorType) { function getFormat(channels) { switch (channels) { case 1: - return WebGLConstants.ALPHA; + return WebGLConstants.LUMINANCE; case 2: return WebGLConstants.LUMINANCE_ALPHA; case 3: diff --git a/specs/lib/loadImageSpec.js b/specs/lib/loadImageSpec.js index 3554d83..8a5dccc 100644 --- a/specs/lib/loadImageSpec.js +++ b/specs/lib/loadImageSpec.js @@ -60,7 +60,7 @@ describe('loadImage', function() { expect(loadImage(grayscaleImage, defaultOptions) .then(function(info) { expect(info.transparent).toBe(false); - expect(info.format).toBe(WebGLConstants.ALPHA); + expect(info.format).toBe(WebGLConstants.LUMINANCE); expect(info.source).toBeDefined(); expect(info.extension).toBe('.png'); }), done).toResolve(); From 55b123add0e2849272db80d42a3af3cf3372d8c5 Mon Sep 17 00:00:00 2001 From: Kangning Li Date: Thu, 7 Jun 2018 15:08:22 -0400 Subject: [PATCH 2/3] update CHANGES.md --- CHANGES.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index 489229f..30bc42a 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,9 @@ Change Log ========== +### 1.4.0 +* Fixed greyscale images loading as alpha instead of luminance. [#144](https://github.com/AnalyticalGraphicsInc/obj2gltf/pull/144) + ### 1.3.1 2018-03-28 * Maintenance release to update major version Node dependencies. From 0e1f7146d8583bbbec6cc9aa97abc3d526ca8067 Mon Sep 17 00:00:00 2001 From: Kangning Li Date: Thu, 7 Jun 2018 15:13:16 -0400 Subject: [PATCH 3/3] edit CHANGES.md version --- CHANGES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 30bc42a..516a0c4 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,7 +1,7 @@ Change Log ========== -### 1.4.0 +### 1.3.2 2018-06-07 * Fixed greyscale images loading as alpha instead of luminance. [#144](https://github.com/AnalyticalGraphicsInc/obj2gltf/pull/144) ### 1.3.1 2018-03-28