OpenComic icon indicating copy to clipboard operation
OpenComic copied to clipboard

[Bug]: "The source image cannot be decoded" and sidebar thumbnails not shown

Open gsxgmpkt9020 opened this issue 6 months ago • 6 comments

Preflight Checklist

  • [x] I have searched the issue tracker for a bug report that matches the one I want to file, without success.

OpenComic Version

1.4.1.master.6fe5358

Operating System

Windows 10 Version 22H2 (Build 19045.3324)

Installed via

exe

Steps to reproduce

Open certain files

Expected Behavior

No errors and sidebar thumbnails can be shown.

Actual Behavior

"The source image cannot be decoded" and sidebar thumbnails not shown

Image

Error message

Uncaught (in promise) EncodingError: The source image cannot be decoded.
C:\Program Files\OpenComic\resources\app.asar\scripts\file-manager.js:1094 readCompressed | 7z (cbz) | D:\Komga\Storyarc\SA_D\1.cbz: 34.638916015625 ms
C:\Program Files\OpenComic\resources\app.asar\scripts\file-manager.js:1351 extractCompressed | 7z (cbz) | (2 files) D:\Komga\Storyarc\SA_D\1.cbz: 459.464111328125 ms

Additional Information

Please remove the zip extension of the attached sample file

Sample file

1.cbz.zip

gsxgmpkt9020 avatar May 23 '25 00:05 gsxgmpkt9020

I can't reproduce the issue with the sample file.

Is it still happening? I see the image is displayed on the right side, maybe the error is caused by another file.

Image

ollm avatar May 26 '25 17:05 ollm

I can't reproduce the issue with the sample file.

Is it still happening? I see the image is displayed on the right side, maybe the error is caused by another file.

Image

Try this large file : https://www.filemail.com/d/mgjyaypduvahkbs

C:\Program Files\OpenComic\resources\app.asar\scripts\file-manager.js:1351 extractCompressed | 7z (cbz) | (490 files) D:\Komga\Storyarc\SA_D\霸佔人妻\霸佔人妻 1-8話.cbz: 2411.43603515625 ms
[Violation] Forced reflow while executing JavaScript took 41ms
C:\Program Files\OpenComic\resources\app.asar\node_modules\jquery\dist\jquery.js:4997 [Violation] Added non-passive event listener to a scroll-blocking 'mousewheel' event. Consider marking event handler as 'passive' to make the page more responsive. See https://www.chromestatus.com/feature/5745543795965952
add @ C:\Program Files\OpenComic\resources\app.asar\node_modules\jquery\dist\jquery.js:4997
(anonymous) @ C:\Program Files\OpenComic\resources\app.asar\node_modules\jquery\dist\jquery.js:4897
each @ C:\Program Files\OpenComic\resources\app.asar\node_modules\jquery\dist\jquery.js:383
each @ C:\Program Files\OpenComic\resources\app.asar\node_modules\jquery\dist\jquery.js:205
on @ C:\Program Files\OpenComic\resources\app.asar\node_modules\jquery\dist\jquery.js:4896
on @ C:\Program Files\OpenComic\resources\app.asar\node_modules\jquery\dist\jquery.js:5736
read @ C:\Program Files\OpenComic\resources\app.asar\scripts\reading.js:4952
openComic @ C:\Program Files\OpenComic\resources\app.asar\scripts\dom.js:2709
C:\Program Files\OpenComic\resources\app.asar\node_modules\jquery\dist\jquery.js:4997 [Violation] Added non-passive event listener to a scroll-blocking 'mousewheel' event. Consider marking event handler as 'passive' to make the page more responsive. See https://www.chromestatus.com/feature/5745543795965952
add @ C:\Program Files\OpenComic\resources\app.asar\node_modules\jquery\dist\jquery.js:4997
(anonymous) @ C:\Program Files\OpenComic\resources\app.asar\node_modules\jquery\dist\jquery.js:4897
each @ C:\Program Files\OpenComic\resources\app.asar\node_modules\jquery\dist\jquery.js:383
each @ C:\Program Files\OpenComic\resources\app.asar\node_modules\jquery\dist\jquery.js:205
on @ C:\Program Files\OpenComic\resources\app.asar\node_modules\jquery\dist\jquery.js:4896
on @ C:\Program Files\OpenComic\resources\app.asar\node_modules\jquery\dist\jquery.js:5736
read @ C:\Program Files\OpenComic\resources\app.asar\scripts\reading.js:4964
openComic @ C:\Program Files\OpenComic\resources\app.asar\scripts\dom.js:2709
C:\Program Files\OpenComic\resources\app.asar\node_modules\jquery\dist\jquery.js:4997 [Violation] Added non-passive event listener to a scroll-blocking 'touchmove' event. Consider marking event handler as 'passive' to make the page more responsive. See https://www.chromestatus.com/feature/5745543795965952
add @ C:\Program Files\OpenComic\resources\app.asar\node_modules\jquery\dist\jquery.js:4997
(anonymous) @ C:\Program Files\OpenComic\resources\app.asar\node_modules\jquery\dist\jquery.js:4897
each @ C:\Program Files\OpenComic\resources\app.asar\node_modules\jquery\dist\jquery.js:383
each @ C:\Program Files\OpenComic\resources\app.asar\node_modules\jquery\dist\jquery.js:205
on @ C:\Program Files\OpenComic\resources\app.asar\node_modules\jquery\dist\jquery.js:4896
on @ C:\Program Files\OpenComic\resources\app.asar\node_modules\jquery\dist\jquery.js:5736
read @ C:\Program Files\OpenComic\resources\app.asar\scripts\reading.js:5294
openComic @ C:\Program Files\OpenComic\resources\app.asar\scripts\dom.js:2709
C:\Program Files\OpenComic\resources\app.asar\node_modules\jquery\dist\jquery.js:4944 [Violation] Handling of 'mousewheel' input event was delayed for 156 ms due to main thread being busy. Consider marking event handler as 'passive' to make the page more responsive.
index.html:1 Uncaught (in promise) EncodingError: The source image cannot be decoded.

-1748321027074.log

Image

Image

Image

gsxgmpkt9020 avatar May 27 '25 04:05 gsxgmpkt9020

I still can't reproduce the issue. The only thing I can think of is that the image is not completely written to disk when it is opened.

I have improved the checks that are made when extracting files e3b2cfa252abed8a8432801604132c831b349f47

Build: https://mega.nz/file/vHxz3BpT#7ozuQ6SBseVcI-KcTV9PhFDyI1Q8PaDqPWnDBUitcXc

If it still doesn't work, I recommend trying to clear the cache and temporary files from the OpenComic settings.

ollm avatar May 28 '25 06:05 ollm

I still can't reproduce the issue. The only thing I can think of is that the image is not completely written to disk when it is opened.

I have improved the checks that are made when extracting files e3b2cfa

Build: https://mega.nz/file/vHxz3BpT#7ozuQ6SBseVcI-KcTV9PhFDyI1Q8PaDqPWnDBUitcXc

If it still doesn't work, I recommend trying to clear the cache and temporary files from the OpenComic settings.

Image

Sidebar thumbnails are shown now ! Thanks for your hardworking ! This new build really works.

gsxgmpkt9020 avatar May 28 '25 09:05 gsxgmpkt9020

New version not totally prevent this and "cLear cache for every single new cbz file" solved everything about this. Maybe third-party plugins slowed / stuck sth:

I installed WebP-Codec-for-Windows & Icaros Shell Extensions

WebP-Codec-for-Windows.html

Xanashi/Icaros: Official issue tracker and download location for Icaros Shell Extensions

You can test them in a virtual machine with opencomic

gsxgmpkt9020 avatar Jun 01 '25 22:06 gsxgmpkt9020

These codecs shouldn't affect OpenComic.

If clearing the cache solves the problem, it's most likely because the cache was generated by the previous version of OpenComic and doesn't yet contain the file size reported by 7zip. This size is used to check whether the file has been fully written to disk or not.

You can force a complete cache deletion from the settings. If you continue to have this issue, then it may be something else, or the isFullyWrittenToDisk check might be failing.

https://github.com/ollm/OpenComic/blob/ad1f831710ce7a50b6cf73d7a18dc7fff07d6157/scripts/file-manager.js#L1788-L1803

ollm avatar Jun 02 '25 10:06 ollm

Closing this, since the fix is now available in v1.6.0

ollm avatar Jul 27 '25 19:07 ollm