Skip to content

Commit 1439b9b

Browse files
authored
Fix: Error Failed to retrieve track metadata in some images
1 parent aa7bb3c commit 1439b9b

2 files changed

Lines changed: 17 additions & 9 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
3333
- Improved extract performance of big files [`5c50739`](https://github.com/ollm/OpenComic/commit/5c507391939c9e56cb1d304df9b3824116de67f4)
3434
- Support MyAnimeList tracking [`5f40b4a`](https://github.com/ollm/OpenComic/commit/5f40b4af1b70e8cfaad0beb79fec676c9c1c83fe)
3535
- Multi-layer folder labeling/favoriting and header bar filter options [`652a6a5`](https://github.com/ollm/OpenComic/commit/652a6a522b32fb9bf77a8dbfebafc0496050c634)
36-
- Option to disable tap zones
36+
- Option to disable tap zones [`aa7bb3c`](https://github.com/ollm/OpenComic/commit/aa7bb3cc4350616bc527c622be5ed7ddf2d5d611)
3737

3838
##### 🐛 Bug Fixes
3939

@@ -48,6 +48,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
4848
- Check if the file is written to disk when extracting using 7zip [`66d4897`](https://github.com/ollm/OpenComic/commit/66d48977b4ef33b320676d39656d48ea41aff653)
4949
- Wrong size detection for animated AVIF images [`b741e52`](https://github.com/ollm/OpenComic/commit/b741e52c1fffac842a782fc45536eada123edeba)
5050
- Compressed files with unsupported chars in Windows are not correct displayed [`120c86b`](https://github.com/ollm/OpenComic/commit/120c86b847259e4a6d8c1302f6691edd75fcae21)
51+
- Error `Failed to retrieve track metadata` in some images
5152

5253
## [v1.4.1](https://github.com/ollm/OpenComic/releases/tag/v1.4.1) (08-02-2025)
5354

scripts/image.js

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -274,19 +274,26 @@ async function isAnimated(path)
274274
else if(compatible.image.gif.has(extension))
275275
type = 'image/gif';
276276

277-
let decoder = new ImageDecoder({data: await fsp.readFile(path), type: type});
278-
await decoder.tracks.ready;
279-
280-
for(let i = 0, len = decoder.tracks.length; i < len; i++)
277+
try
281278
{
282-
if(decoder.tracks[i].animated || decoder.tracks[i].frameCount > 1)
279+
let decoder = new ImageDecoder({data: await fsp.readFile(path), type: type});
280+
await decoder.tracks.ready;
281+
282+
for(let i = 0, len = decoder.tracks.length; i < len; i++)
283283
{
284-
_isAnimated = true;
285-
break;
284+
if(decoder.tracks[i].animated || decoder.tracks[i].frameCount > 1)
285+
{
286+
_isAnimated = true;
287+
break;
288+
}
286289
}
287290
}
291+
catch(error)
292+
{
293+
if(!/Failed to retrieve track metadata/iu.test(error))
294+
console.error(error);
295+
}
288296
}
289-
290297

291298
isAnimatedCache[path] = _isAnimated;
292299
return _isAnimated;

0 commit comments

Comments
 (0)