Skip to content

Commit

Permalink
Use fflate not pako
Browse files Browse the repository at this point in the history
  • Loading branch information
neurolabusc committed Apr 1, 2023
1 parent 6853707 commit 49003b2
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
".gitignore"
],
"dependencies": {
"pako": "*",
"fflate": "*",
"jpeg-lossless-decoder-js": "git+https://github.com/rii-mango/JPEGLosslessDecoderJS.git"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 3 additions & 1 deletion src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 ***/

Expand Down
8 changes: 5 additions & 3 deletions src/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 ***/

Expand Down Expand Up @@ -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);
}

Expand Down

0 comments on commit 49003b2

Please sign in to comment.