Bug 489295 - Okular 24.05.1 - Comic book - Arch Linux - Some distorted AVIF pages in zip compressed (cbz) comic books.
Summary: Okular 24.05.1 - Comic book - Arch Linux - Some distorted AVIF pages in zip c...
Status: RESOLVED NOT A BUG
Alias: None
Product: okular
Classification: Applications
Component: Comicbook backend (show other bugs)
Version: 24.05.1
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-06-27 09:55 UTC by ElManazas
Modified: 2024-06-30 22:26 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Original images and script for building a buggy comic book (458.46 KB, application/x-7z-compressed)
2024-06-27 09:55 UTC, ElManazas
Details
3 different examples of cbz comics with avif images (1.71 MB, application/x-7z-compressed)
2024-06-28 07:24 UTC, ElManazas
Details
Same 3 cbz comics but with jxl images (2.57 MB, application/x-7z-compressed)
2024-06-28 13:15 UTC, ElManazas
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ElManazas 2024-06-27 09:55:49 UTC
Created attachment 171075 [details]
Original images and script for building a buggy comic book

System information: Arch linux + plasma-meta + okular + kimageformats + libavif + libheif (all completely updated)

Material.7z content for reproducing the bug :
---------------------------------------------
- Images downloaded from: https://wiki.creativecommons.org/wiki/Spectrumofrights_Comic1
- convertir_AVIF.sh script: Takes a 'directory' as unique argument ¡¡¡¡ without the ending slash '/' !!!!! (if the ending slash is included the ending comic book creates inside this directory and the last command removes this directory with the comic) and produces a directory.cbz comic book
- In this case the pages were vertically oriented (-rotate 90 imagemagick argument) for being able to reproduce the bug.

SUMMARY:
--------
If an AVIF formated images containing zip compressed comic book (cbz) is opened, some pages are vertically stretched and horizontally shrink, so they are completely deformed. Using 7z (-tzip argument) or zip make different pages to be deformed (what is deformed with a compression tool may not be deformed with the other tool):
"zip -r comic.cbz directory" has deformed images as "7z -tzip comic.cbz directory" has, but they may be in different locations.

If the comic book is uncompressed (7z x comic.cbz) gwenview show images correctly. If tar (-ttar 7z parameter) or 7z default algorithm are used there is no problem. Extracting the deformed pages and opening them individually (okular extracted_image.avif) shows them correctly. The bug only occurs if an AVIF images containing directory is compresed in zip format for creating a cbz comic book.

Resuming:
- Extract Material.7z content.
- The argument directory of convertir_AVIF.sh will be removed so create a copy of Imágenes directory. For this example: cp -r Imágenes Cómic
- Execute "sh convertir_AVIF.sh Cómic"
- Open the resulting Cómic.cbz file with okular
- There will be some disorted images. (If not forget this bug report and I'll have to dig in my system to find the source of the error XD)

- Modifications to the script:
7z -tzip a "$1".cbz "$1" &&\ -> zip -r "$1".cbz "$1" &&\ [Will have deformed images too, possibly in different locations]
7z -tzip a "$1".cbz "$1" &&\ -> 7z -ttar a "$1".cbt "$1" &&\ [The generated comic book will not have any problem]
7z -tzip a "$1".cbz "$1" &&\ -> 7z a "$1".cb7 "$1" &&\ [The generated comic book will not have any problem]

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Arch + Plasma 6.1.0 
(available in About System)
KDE Plasma Version: 6.1.0
KDE Frameworks Version: 6.3.0
Qt Version: 6.7.2
Comment 1 Albert Astals Cid 2024-06-27 21:39:14 UTC
Please don't give us extra work, just attach the file that fails.
Comment 2 ElManazas 2024-06-28 07:24:32 UTC
Created attachment 171116 [details]
3 different examples of cbz comics with avif images

Sorry. The last attachment has 3 examples of failing files.

If you want to build your own failing comics you can follow the steps described in the original post. As more images stored in the target directory higher the probabilities of okular distorting any page are.

As said, it only happens with avif+zip combination, any other image format (I tried jpg, jpeg-xl and webp) is shown correctly, as correctly are shown avif images containing non zip compressed comics.

I see a lot of distorted pages in the files that I attached, if in your case okular displays them well say it to me please.

Thank you for your time!
Comment 3 ElManazas 2024-06-28 13:15:05 UTC
Created attachment 171130 [details]
Same 3 cbz comics but with jxl images
Comment 4 ElManazas 2024-06-30 08:06:25 UTC
(In reply to Albert Astals Cid from comment #1)
> Please don't give us extra work, just attach the file that fails.

I finally reinstalled the system and all works well.

Sorry for the inconvenience.