diff --git a/example/public/0001.webp b/example/public/0001.webp deleted file mode 100644 index a6bdd07..0000000 Binary files a/example/public/0001.webp and /dev/null differ diff --git a/example/public/0002.webp b/example/public/0002.webp deleted file mode 100644 index d55d9ca..0000000 Binary files a/example/public/0002.webp and /dev/null differ diff --git a/example/public/0003.webp b/example/public/0003.webp deleted file mode 100644 index 7d7a5d2..0000000 Binary files a/example/public/0003.webp and /dev/null differ diff --git a/example/public/0004.webp b/example/public/0004.webp deleted file mode 100644 index e97b568..0000000 Binary files a/example/public/0004.webp and /dev/null differ diff --git a/example/public/0005.webp b/example/public/0005.webp deleted file mode 100644 index 51beb67..0000000 Binary files a/example/public/0005.webp and /dev/null differ diff --git a/example/public/0006.webp b/example/public/0006.webp deleted file mode 100644 index ad67ce4..0000000 Binary files a/example/public/0006.webp and /dev/null differ diff --git a/example/public/0007.webp b/example/public/0007.webp deleted file mode 100644 index 37f6b08..0000000 Binary files a/example/public/0007.webp and /dev/null differ diff --git a/example/public/0008.webp b/example/public/0008.webp deleted file mode 100644 index 26b067e..0000000 Binary files a/example/public/0008.webp and /dev/null differ diff --git a/example/public/0009.webp b/example/public/0009.webp deleted file mode 100644 index 75ba12f..0000000 Binary files a/example/public/0009.webp and /dev/null differ diff --git a/example/public/0010.webp b/example/public/0010.webp deleted file mode 100644 index 5d4d080..0000000 Binary files a/example/public/0010.webp and /dev/null differ diff --git a/example/public/0011.webp b/example/public/0011.webp deleted file mode 100644 index 07e6d16..0000000 Binary files a/example/public/0011.webp and /dev/null differ diff --git a/example/public/0012.webp b/example/public/0012.webp deleted file mode 100644 index ac032b2..0000000 Binary files a/example/public/0012.webp and /dev/null differ diff --git a/example/public/0013.webp b/example/public/0013.webp deleted file mode 100644 index 8d9386d..0000000 Binary files a/example/public/0013.webp and /dev/null differ diff --git a/example/public/0014.webp b/example/public/0014.webp deleted file mode 100644 index ae6bcf8..0000000 Binary files a/example/public/0014.webp and /dev/null differ diff --git a/example/public/0015.webp b/example/public/0015.webp deleted file mode 100644 index c2be26a..0000000 Binary files a/example/public/0015.webp and /dev/null differ diff --git a/example/public/0016.webp b/example/public/0016.webp deleted file mode 100644 index a5d342b..0000000 Binary files a/example/public/0016.webp and /dev/null differ diff --git a/example/public/0017.webp b/example/public/0017.webp deleted file mode 100644 index cfebe59..0000000 Binary files a/example/public/0017.webp and /dev/null differ diff --git a/example/public/0018.webp b/example/public/0018.webp deleted file mode 100644 index ffed22e..0000000 Binary files a/example/public/0018.webp and /dev/null differ diff --git a/example/public/0019.webp b/example/public/0019.webp deleted file mode 100644 index ae78423..0000000 Binary files a/example/public/0019.webp and /dev/null differ diff --git a/example/public/0020.webp b/example/public/0020.webp deleted file mode 100644 index 166d89e..0000000 Binary files a/example/public/0020.webp and /dev/null differ diff --git a/example/public/0021.webp b/example/public/0021.webp deleted file mode 100644 index ec73d37..0000000 Binary files a/example/public/0021.webp and /dev/null differ diff --git a/example/public/0022.webp b/example/public/0022.webp deleted file mode 100644 index 8260e37..0000000 Binary files a/example/public/0022.webp and /dev/null differ diff --git a/example/public/0023.webp b/example/public/0023.webp deleted file mode 100644 index 08e8111..0000000 Binary files a/example/public/0023.webp and /dev/null differ diff --git a/example/public/0024.webp b/example/public/0024.webp deleted file mode 100644 index d35df2c..0000000 Binary files a/example/public/0024.webp and /dev/null differ diff --git a/example/public/0025.webp b/example/public/0025.webp deleted file mode 100644 index 7ff1985..0000000 Binary files a/example/public/0025.webp and /dev/null differ diff --git a/example/public/0026.webp b/example/public/0026.webp deleted file mode 100644 index a963571..0000000 Binary files a/example/public/0026.webp and /dev/null differ diff --git a/example/public/0027.webp b/example/public/0027.webp deleted file mode 100644 index 7e4df36..0000000 Binary files a/example/public/0027.webp and /dev/null differ diff --git a/example/public/0028.webp b/example/public/0028.webp deleted file mode 100644 index 3161635..0000000 Binary files a/example/public/0028.webp and /dev/null differ diff --git a/example/public/0029.webp b/example/public/0029.webp deleted file mode 100644 index a227962..0000000 Binary files a/example/public/0029.webp and /dev/null differ diff --git a/example/public/0030.webp b/example/public/0030.webp deleted file mode 100644 index 3c269c3..0000000 Binary files a/example/public/0030.webp and /dev/null differ diff --git a/example/public/0031.webp b/example/public/0031.webp deleted file mode 100644 index c8a271e..0000000 Binary files a/example/public/0031.webp and /dev/null differ diff --git a/example/public/0032.webp b/example/public/0032.webp deleted file mode 100644 index 0b2efd9..0000000 Binary files a/example/public/0032.webp and /dev/null differ diff --git a/example/public/0033.webp b/example/public/0033.webp deleted file mode 100644 index c7bd52e..0000000 Binary files a/example/public/0033.webp and /dev/null differ diff --git a/example/public/0034.webp b/example/public/0034.webp deleted file mode 100644 index 3f4e872..0000000 Binary files a/example/public/0034.webp and /dev/null differ diff --git a/example/public/0035.webp b/example/public/0035.webp deleted file mode 100644 index bd0156a..0000000 Binary files a/example/public/0035.webp and /dev/null differ diff --git a/example/public/0036.webp b/example/public/0036.webp deleted file mode 100644 index 7de1d2c..0000000 Binary files a/example/public/0036.webp and /dev/null differ diff --git a/example/public/0037.webp b/example/public/0037.webp deleted file mode 100644 index 50156f7..0000000 Binary files a/example/public/0037.webp and /dev/null differ diff --git a/example/public/0038.webp b/example/public/0038.webp deleted file mode 100644 index 7012838..0000000 Binary files a/example/public/0038.webp and /dev/null differ diff --git a/example/public/0039.webp b/example/public/0039.webp deleted file mode 100644 index 48c8552..0000000 Binary files a/example/public/0039.webp and /dev/null differ diff --git a/example/public/0040.webp b/example/public/0040.webp deleted file mode 100644 index cd603f6..0000000 Binary files a/example/public/0040.webp and /dev/null differ diff --git a/example/public/0041.webp b/example/public/0041.webp deleted file mode 100644 index 4d57e0e..0000000 Binary files a/example/public/0041.webp and /dev/null differ diff --git a/example/public/0042.webp b/example/public/0042.webp deleted file mode 100644 index 9dc449c..0000000 Binary files a/example/public/0042.webp and /dev/null differ diff --git a/example/public/0043.webp b/example/public/0043.webp deleted file mode 100644 index 4669613..0000000 Binary files a/example/public/0043.webp and /dev/null differ diff --git a/example/public/0044.webp b/example/public/0044.webp deleted file mode 100644 index 77dd9d7..0000000 Binary files a/example/public/0044.webp and /dev/null differ diff --git a/example/public/0045.webp b/example/public/0045.webp deleted file mode 100644 index 671249e..0000000 Binary files a/example/public/0045.webp and /dev/null differ diff --git a/example/public/0046.webp b/example/public/0046.webp deleted file mode 100644 index 61e3ba1..0000000 Binary files a/example/public/0046.webp and /dev/null differ diff --git a/example/public/0047.webp b/example/public/0047.webp deleted file mode 100644 index 6c7530a..0000000 Binary files a/example/public/0047.webp and /dev/null differ diff --git a/example/public/0048.webp b/example/public/0048.webp deleted file mode 100644 index afc6272..0000000 Binary files a/example/public/0048.webp and /dev/null differ diff --git a/example/public/0049.webp b/example/public/0049.webp deleted file mode 100644 index 8ef2b32..0000000 Binary files a/example/public/0049.webp and /dev/null differ diff --git a/example/public/0050.webp b/example/public/0050.webp deleted file mode 100644 index 8679009..0000000 Binary files a/example/public/0050.webp and /dev/null differ diff --git a/example/public/0051.webp b/example/public/0051.webp deleted file mode 100644 index 7b59ca7..0000000 Binary files a/example/public/0051.webp and /dev/null differ diff --git a/example/public/0052.webp b/example/public/0052.webp deleted file mode 100644 index 8366587..0000000 Binary files a/example/public/0052.webp and /dev/null differ diff --git a/example/public/0053.webp b/example/public/0053.webp deleted file mode 100644 index 7b8e353..0000000 Binary files a/example/public/0053.webp and /dev/null differ diff --git a/example/public/0054.webp b/example/public/0054.webp deleted file mode 100644 index e442d87..0000000 Binary files a/example/public/0054.webp and /dev/null differ diff --git a/example/public/0055.webp b/example/public/0055.webp deleted file mode 100644 index 29a83b4..0000000 Binary files a/example/public/0055.webp and /dev/null differ diff --git a/example/public/0056.webp b/example/public/0056.webp deleted file mode 100644 index f696ad9..0000000 Binary files a/example/public/0056.webp and /dev/null differ diff --git a/example/public/0057.webp b/example/public/0057.webp deleted file mode 100644 index 3a2331a..0000000 Binary files a/example/public/0057.webp and /dev/null differ diff --git a/example/public/0058.webp b/example/public/0058.webp deleted file mode 100644 index e3e83e7..0000000 Binary files a/example/public/0058.webp and /dev/null differ diff --git a/example/public/0059.webp b/example/public/0059.webp deleted file mode 100644 index 5f51c17..0000000 Binary files a/example/public/0059.webp and /dev/null differ diff --git a/example/public/0060.webp b/example/public/0060.webp deleted file mode 100644 index f3e31b4..0000000 Binary files a/example/public/0060.webp and /dev/null differ diff --git a/example/public/0061.webp b/example/public/0061.webp deleted file mode 100644 index 8c060b5..0000000 Binary files a/example/public/0061.webp and /dev/null differ diff --git a/example/public/0062.webp b/example/public/0062.webp deleted file mode 100644 index 1c2bee9..0000000 Binary files a/example/public/0062.webp and /dev/null differ diff --git a/example/public/0063.webp b/example/public/0063.webp deleted file mode 100644 index f2f88c7..0000000 Binary files a/example/public/0063.webp and /dev/null differ diff --git a/example/public/0064.webp b/example/public/0064.webp deleted file mode 100644 index f6c3b93..0000000 Binary files a/example/public/0064.webp and /dev/null differ diff --git a/example/public/0065.webp b/example/public/0065.webp deleted file mode 100644 index fb75b4c..0000000 Binary files a/example/public/0065.webp and /dev/null differ diff --git a/example/public/0066.webp b/example/public/0066.webp deleted file mode 100644 index edf6e92..0000000 Binary files a/example/public/0066.webp and /dev/null differ diff --git a/example/public/0067.webp b/example/public/0067.webp deleted file mode 100644 index 6ffc8ca..0000000 Binary files a/example/public/0067.webp and /dev/null differ diff --git a/example/public/0068.webp b/example/public/0068.webp deleted file mode 100644 index b83e878..0000000 Binary files a/example/public/0068.webp and /dev/null differ diff --git a/example/public/0069.webp b/example/public/0069.webp deleted file mode 100644 index 937e22c..0000000 Binary files a/example/public/0069.webp and /dev/null differ diff --git a/example/public/0070.webp b/example/public/0070.webp deleted file mode 100644 index 7bc12a1..0000000 Binary files a/example/public/0070.webp and /dev/null differ diff --git a/example/public/0071.webp b/example/public/0071.webp deleted file mode 100644 index b29b43c..0000000 Binary files a/example/public/0071.webp and /dev/null differ diff --git a/example/public/0072.webp b/example/public/0072.webp deleted file mode 100644 index 4f8277a..0000000 Binary files a/example/public/0072.webp and /dev/null differ diff --git a/example/public/0073.webp b/example/public/0073.webp deleted file mode 100644 index 2aa93ca..0000000 Binary files a/example/public/0073.webp and /dev/null differ diff --git a/example/public/0074.webp b/example/public/0074.webp deleted file mode 100644 index e9b5c47..0000000 Binary files a/example/public/0074.webp and /dev/null differ diff --git a/example/public/0075.webp b/example/public/0075.webp deleted file mode 100644 index e50c6f7..0000000 Binary files a/example/public/0075.webp and /dev/null differ diff --git a/example/public/0076.webp b/example/public/0076.webp deleted file mode 100644 index 81c0585..0000000 Binary files a/example/public/0076.webp and /dev/null differ diff --git a/example/public/0077.webp b/example/public/0077.webp deleted file mode 100644 index 40576b6..0000000 Binary files a/example/public/0077.webp and /dev/null differ diff --git a/example/public/0078.webp b/example/public/0078.webp deleted file mode 100644 index fe7c470..0000000 Binary files a/example/public/0078.webp and /dev/null differ diff --git a/example/public/0079.webp b/example/public/0079.webp deleted file mode 100644 index e106bd2..0000000 Binary files a/example/public/0079.webp and /dev/null differ diff --git a/example/public/0080.webp b/example/public/0080.webp deleted file mode 100644 index 7949df9..0000000 Binary files a/example/public/0080.webp and /dev/null differ diff --git a/example/public/0081.webp b/example/public/0081.webp deleted file mode 100644 index fba9129..0000000 Binary files a/example/public/0081.webp and /dev/null differ diff --git a/example/public/0082.webp b/example/public/0082.webp deleted file mode 100644 index 5c414a6..0000000 Binary files a/example/public/0082.webp and /dev/null differ diff --git a/example/public/0083.webp b/example/public/0083.webp deleted file mode 100644 index 1460608..0000000 Binary files a/example/public/0083.webp and /dev/null differ diff --git a/example/public/0084.webp b/example/public/0084.webp deleted file mode 100644 index 1774730..0000000 Binary files a/example/public/0084.webp and /dev/null differ diff --git a/example/public/0085.webp b/example/public/0085.webp deleted file mode 100644 index 58e8283..0000000 Binary files a/example/public/0085.webp and /dev/null differ diff --git a/example/public/0086.webp b/example/public/0086.webp deleted file mode 100644 index 22fd529..0000000 Binary files a/example/public/0086.webp and /dev/null differ diff --git a/example/public/0087.webp b/example/public/0087.webp deleted file mode 100644 index 06e7b2b..0000000 Binary files a/example/public/0087.webp and /dev/null differ diff --git a/example/public/0088.webp b/example/public/0088.webp deleted file mode 100644 index 377acb3..0000000 Binary files a/example/public/0088.webp and /dev/null differ diff --git a/example/public/0089.webp b/example/public/0089.webp deleted file mode 100644 index 6f49130..0000000 Binary files a/example/public/0089.webp and /dev/null differ diff --git a/example/public/0090.webp b/example/public/0090.webp deleted file mode 100644 index 753dab5..0000000 Binary files a/example/public/0090.webp and /dev/null differ diff --git a/example/public/lowrespreviews.tar b/example/public/lowrespreviews.tar deleted file mode 100644 index 96e0361..0000000 Binary files a/example/public/lowrespreviews.tar and /dev/null differ diff --git a/example/src/exampleConstructDestructTest.js b/example/src/exampleConstructDestructTest.js index 211853b..ad739e3 100644 --- a/example/src/exampleConstructDestructTest.js +++ b/example/src/exampleConstructDestructTest.js @@ -16,12 +16,12 @@ function createFastImageSequence(container) { const src = []; const imageSrc = { - imageURL: (i) => `${('' + (i + 1)).padStart(4, '0')}.webp`, + imageURL: (i) => `sequence_1/${('' + (i + 1)).padStart(4, '0')}.webp`, useWorker: Math.random() > .5, // default true maxCachedImages: (1 + Math.random() * 32) | 0, // default 32 }; const tarSrc = { - tarURL: 'lowrespreviews.tar', + tarURL: 'sequence_1/lowrespreviews.tar', imageURL: (i) => `${('' + (i + 1)).padStart(4, '0')}.jpg`, useWorker: Math.random() > .5, // default true maxCachedImages: (1 + Math.random() * 32) | 0, // default 32 diff --git a/example/src/exampleLoadTar.js b/example/src/exampleLoadTar.js index 7dfceb8..c8a0ed9 100644 --- a/example/src/exampleLoadTar.js +++ b/example/src/exampleLoadTar.js @@ -16,7 +16,7 @@ function blobToDataURL(blob) { export async function initExampleLoadTar(container) { // load tar file with lowres previews - fetch('lowrespreviews.tar').then(async (response) => { + fetch('sequence_1/lowrespreviews.tar').then(async (response) => { const blob = await response.blob(); const dataURL = await blobToDataURL(blob); diff --git a/example/src/examplePlayBackwards.js b/example/src/examplePlayBackwards.js index d4f54c2..e73a4f2 100644 --- a/example/src/examplePlayBackwards.js +++ b/example/src/examplePlayBackwards.js @@ -3,13 +3,13 @@ import {FastImageSequence} from '../../src/index'; export async function initExamplePlayBackwards(container) { const fastImageSequence = new FastImageSequence(container, { name: 'PlayBackwardsTest at 200fps', - frames: 89, + frames: 120, src: { - imageURL: (i) => `${('' + (i + 1)).padStart(4, '0')}.webp`, + imageURL: (i) => `sequence_2/${('' + (i + 1)).padStart(3, '0')}.jpg`, }, // optional arguments: loop: true, // default false - objectFit: 'cover', // default 'cover' + objectFit: 'contain', // default 'cover' fillStyle: '#00000000', // default #00000000 clearCanvas: false, // default false showDebugInfo: true, diff --git a/example/src/exampleStillImage.js b/example/src/exampleStillImage.js index 7596f72..6556905 100644 --- a/example/src/exampleStillImage.js +++ b/example/src/exampleStillImage.js @@ -5,7 +5,7 @@ export async function initExampleStillImage(container) { name: 'StillImageTest', frames: 89, src: { - imageURL: (i) => `${('' + (i + 1)).padStart(4, '0')}.webp`, + imageURL: (i) => `sequence_1/${('' + (i + 1)).padStart(4, '0')}.webp`, maxCachedImages: 1, // default 32 useWorker: true, }, diff --git a/example/src/exampleWithControl.js b/example/src/exampleWithControl.js index 8559eaa..5167ede 100644 --- a/example/src/exampleWithControl.js +++ b/example/src/exampleWithControl.js @@ -10,11 +10,11 @@ export async function initExampleWithControl(container) { frames: 89, src: [ { - imageURL: (i) => `${('' + (i + 1)).padStart(4, '0')}.webp`, + imageURL: (i) => `sequence_1/${('' + (i + 1)).padStart(4, '0')}.webp`, maxCachedImages: 8, // default 32 }, { - tarURL: 'lowrespreviews.tar', + tarURL: 'sequence_1/lowrespreviews.tar', imageURL: (i) => `${('' + (i + 1)).padStart(4, '0')}.jpg` } ], diff --git a/src/lib/FastImageSequence.ts b/src/lib/FastImageSequence.ts index c900522..beaf5f5 100644 --- a/src/lib/FastImageSequence.ts +++ b/src/lib/FastImageSequence.ts @@ -350,7 +350,12 @@ export class FastImageSequence { this.log('Poster image', this.options.poster); const posterImage = new Image(); posterImage.src = this.options.poster; - await posterImage.decode().then(() => this.drawImage(this.posterImage = posterImage)).catch((e) => this.log(e)); + await posterImage.decode().then(() => { + this.posterImage = posterImage; + if (this.lastFrameDrawn < 0) { + this.drawImage(this.posterImage); + } + }).catch((e) => this.log(e)); } await Promise.all(this.sources.map(src => src.loadResources())); await this.getFrameImage(0); @@ -436,7 +441,7 @@ export class FastImageSequence { } this.lastFrameDrawn = frame.index; - + this.canvas.setAttribute('data-frame', frame.index.toString()); this.drawImage(image); }