Skip to content

Commit

Permalink
Merge pull request #37 from rii-mango/korbinian90-patch-1
Browse files Browse the repository at this point in the history
Korbinian90 patch 1 (with release related additions)
  • Loading branch information
hanayik authored Nov 13, 2023
2 parents a4ce01d + 77749d0 commit e65e736
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test-linux-node18.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name: test-linux-node18

on:
pull_request:
branches: [main]
branches: [master]

jobs:
build:
Expand Down
2 changes: 1 addition & 1 deletion dist/src/nifti1.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion dist/src/nifti1.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/src/nifti1.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nifti-reader-js",
"version": "0.6.6",
"version": "0.6.7",
"description": "A JavaScript NIfTI file format reader.",
"main": "dist/src/nifti.js",
"browser": "release/current/nifti-reader.js",
Expand Down
4 changes: 2 additions & 2 deletions release/current/nifti-reader-min.js

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion release/current/nifti-reader.js
Original file line number Diff line number Diff line change
Expand Up @@ -2562,7 +2562,12 @@ var require_nifti1 = __commonJS({
this.extensionFlag[1] = utilities_1.Utils.getByteAt(rawData, 348 + 1);
this.extensionFlag[2] = utilities_1.Utils.getByteAt(rawData, 348 + 2);
this.extensionFlag[3] = utilities_1.Utils.getByteAt(rawData, 348 + 3);
if (this.extensionFlag[0]) {
let isExtensionCapable = true;
if (!this.isHDR && this.vox_offset <= 352)
isExtensionCapable = false;
if (rawData.byteLength <= 352 + 16)
isExtensionCapable = false;
if (isExtensionCapable && this.extensionFlag[0]) {
this.extensions = utilities_1.Utils.getExtensionsAt(rawData, this.getExtensionLocation(), this.littleEndian, this.vox_offset);
this.extensionSize = this.extensions[0].esize;
this.extensionCode = this.extensions[0].ecode;
Expand Down
9 changes: 8 additions & 1 deletion src/nifti1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,14 @@ import { Utils } from "./utilities";
this.extensionFlag[1] = Utils.getByteAt(rawData, 348 + 1);
this.extensionFlag[2] = Utils.getByteAt(rawData, 348 + 2);
this.extensionFlag[3] = Utils.getByteAt(rawData, 348 + 3);
if (this.extensionFlag[0]) {

let isExtensionCapable = true;
if ((!this.isHDR) && (this.vox_offset <= 352))
isExtensionCapable = false;
if (rawData.byteLength <= (352 + 16))
isExtensionCapable = false;

if (isExtensionCapable && this.extensionFlag[0]) {
// read our extensions
this.extensions = Utils.getExtensionsAt(
rawData,
Expand Down

0 comments on commit e65e736

Please sign in to comment.