Skip to content

Commit

Permalink
feat: add option to skipi image creation (#504)
Browse files Browse the repository at this point in the history
Looks good to me - simply change to allow skipping the image creation.
  • Loading branch information
sedghi authored Jan 5, 2023
1 parent 71dbe09 commit b227795
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/imageLoader/createImage.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,12 @@ function createImage(imageId, pixelData, transferSyntax, options = {}) {
return new Promise((resolve, reject) => {
// eslint-disable-next-line complexity
decodePromise.then(function (imageFrame) {
// if it is desired to skip creating image, return the imageFrame
// after the decode. This might be useful for some applications
// that only need the decoded pixel data and not the image object
if (options.skipCreateImage) {
return resolve(imageFrame);
}
// If we have a target buffer that was written to in the
// Decode task, point the image to it here.
// We can't have done it within the thread incase it was a SharedArrayBuffer.
Expand Down

0 comments on commit b227795

Please sign in to comment.