From 49003b276be2d105767d58b6b3e6400c1e21830e Mon Sep 17 00:00:00 2001 From: neurolabusc Date: Sat, 1 Apr 2023 12:21:55 -0400 Subject: [PATCH] Use fflate not pako --- bower.json | 2 +- package.json | 2 +- src/main.js | 4 +++- src/parser.js | 8 +++++--- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/bower.json b/bower.json index 043cc43..faa0730 100644 --- a/bower.json +++ b/bower.json @@ -10,7 +10,7 @@ ".gitignore" ], "dependencies": { - "pako": "*", + "fflate": "*", "jpeg-lossless-decoder-js": "git+https://github.com/rii-mango/JPEGLosslessDecoderJS.git" }, "devDependencies": { diff --git a/package.json b/package.json index ce80a9e..9bd89b7 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "dependencies": { "@wearemothership/dicom-character-set": "^1.0.4-opt.1", "jpeg-lossless-decoder-js": "git+https://github.com/rii-mango/JPEGLosslessDecoderJS.git#v2.0.4", - "pako": "^1.0.10" + "fflate": "*" }, "devDependencies": { "browserify": "^16.5.0", diff --git a/src/main.js b/src/main.js index 8e447aa..777f7fd 100644 --- a/src/main.js +++ b/src/main.js @@ -35,7 +35,9 @@ var JpxImage = JpxImage || ((typeof require !== 'undefined') ? require('../lib/j var CharLS = CharLS || ((typeof require !== 'undefined') ? require('../lib/charLS-DynamicMemory-browser.js') : null); var JpegLSDecoder = JpegLSDecoder || ((typeof require !== 'undefined') ? require('../lib/jpeg-ls.js') : null); -var pako = pako || ((typeof require !== 'undefined') ? require('pako') : null); +//use fflate not pako +//var pako = pako || ((typeof require !== 'undefined') ? require('pako') : null); +var fflate = fflate || ((typeof require !== 'undefined') ? require('fflate') : null); /*** Exports ***/ diff --git a/src/parser.js b/src/parser.js index af3aae9..495b4cd 100644 --- a/src/parser.js +++ b/src/parser.js @@ -11,8 +11,9 @@ daikon.Utils = daikon.Utils || ((typeof require !== 'undefined') ? require('./ut daikon.Dictionary = daikon.Dictionary || ((typeof require !== 'undefined') ? require('./dictionary.js') : null); daikon.Image = daikon.Image || ((typeof require !== 'undefined') ? require('./image.js') : null); -var pako = pako || ((typeof require !== 'undefined') ? require('pako') : null); - +//use fflate not pako +//var pako = pako || ((typeof require !== 'undefined') ? require('pako') : null); +var fflate = fflate || ((typeof require !== 'undefined') ? require('fflate') : null); /*** Constructor ***/ @@ -119,7 +120,8 @@ daikon.Parser.prototype.parse = function (data) { this.needsDeflate = false; copyMeta = data.buffer.slice(0, tag.offsetEnd); copyDeflated = data.buffer.slice(tag.offsetEnd); - this.inflated = daikon.Utils.concatArrayBuffers(copyMeta, pako.inflateRaw(copyDeflated)); + //this.inflated = daikon.Utils.concatArrayBuffers(copyMeta, pako.inflateRaw(copyDeflated)); + this.inflated = daikon.Utils.concatArrayBuffers(copyMeta, fflate.decompressSync(new Uint8Array(copyDeflated))); data = new DataView(this.inflated); }