novomesk / qt-jpegxl-image-plugin

Qt plug-in to allow Qt and KDE based applications to read/write JXL images.
GNU General Public License v3.0
91 stars 8 forks source link

[Request] Add guide/thoubleshoting #1

Closed master-of-zen closed 3 years ago

master-of-zen commented 3 years ago

I figured out how to make it and install plugin. JPEG XL thumbnails don't show up and image viewers don't recognize it, please help)

novomesk commented 3 years ago

In order to activate thumbnails, it is necessary to update /usr/share/kservices5/imagethumbnail.desktop and the image/jxl mimetype (image-jxl.xml) should be installed.

In order to troubleshot I recommend to start gwenview from konsole to see various debug/error messages: gwenview testimage.jxl

Jxl animations are known not to work now because of https://gitlab.com/wg1/jpeg-xl/-/issues/87

I also use the opt parameter to configure libjxl to see libjxl's internal error messages. BUILD_DIR=/tmp/build ./ci.sh opt

master-of-zen commented 3 years ago

Excuse me for newby mistakes) This issue, not sure how to how to interpret it

Out of all steps only image/jxl mimetype (image-jxl.xml) should be installed. is not done, don't know how to do that. Added file association in settings manually Console

> gwenview output.jxl 
Icon theme "gnome" not found.
org.kde.kdegraphics.gwenview.lib: Unresolved mime type  "image/x-mng"
org.kde.kdegraphics.gwenview.lib: Unresolved raw mime type  "image/x-nikon-nrw"
org.kde.kdegraphics.gwenview.lib: Unresolved raw mime type  "image/x-samsung-srw"

Gwenview gui show this error 2020_12_29_12_36_32

My imagethumbnail.desktop thumbnails.zip

and here file itself file.zip

novomesk commented 3 years ago

Copy image-jxl.xml into the folder /usr/share/mime/packages

I use slightly modified version ( https://gitlab.com/wg1/jpeg-xl/-/issues/81 ):

<?xml version="1.0" encoding="UTF-8"?>
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
  <mime-type type="image/jxl">
    <comment>JPEG XL image</comment>
    <comment xml:lang="fr">image JPEG XL</comment>
    <magic priority="50">
      <match type="string" offset="0" value="\xFF\x0A"/>
      <match type="string" offset="0" value="\0\0\0\x0CJXL \x0D\x0A\x87\x0A"/>
    </magic>
    <glob pattern="*.jxl"/>
  </mime-type>
</mime-info>

I think you made a mistake because you registered image/jpegxl and I believe it should be image/jxl

Run update-mime-database /usr/share/mime

and try again: output

master-of-zen commented 3 years ago

done: Copy image-jxl.xml into the folder /usr/share/mime/packages changed: I think you made a mistake because you registered image/jpegxl and I believe it should be image/jxl done: Run update-mime-database /usr/share/mime

Still doesn't work. same console errors 2020_12_29_13_23_51

novomesk commented 3 years ago

I get same message when my plugin is missing or could not be loaded. I have libqjpegxl.so in /usr/lib64/qt5/plugins/imageformats folder. On some systems it could be /usr/lib/qt/plugins/imageformats/ or /usr/lib/x86_64-linux-gnu/qt5/plugins/imageformats

If it is there, try to go to the folder and check ldd libqjpegxl.so if all required libraries are present.

master-of-zen commented 3 years ago

libjxl.so.0 => not found libjxl_threads.so.0 => not found for /usr/lib/qt/plugins/imageformats/libqjpegxl.so

libjpegxl installed

-- Up-to-date: /usr/local/lib/libjxl.a
-- Up-to-date: /usr/local/lib/libjxl.so.0.2.0
-- Up-to-date: /usr/local/lib/libjxl.so.0
-- Up-to-date: /usr/local/lib/libjxl.so
-- Up-to-date: /usr/local/lib/pkgconfig/libjxl.pc
-- Up-to-date: /usr/local/lib/libjxl_threads.a
-- Up-to-date: /usr/local/lib/libjxl_threads.so.0.2.0
-- Up-to-date: /usr/local/lib/libjxl_threads.so.0
-- Up-to-date: /usr/local/lib/libjxl_threads.so
novomesk commented 3 years ago

OK, you found the problem! I have them installed in /usr/lib64 Try to copy or symlink it there (or maybe /usr/lib on some systems) so the libjxl and libjxl_threads will be found easily.

master-of-zen commented 3 years ago

Yep, it works now))