Version: unspecified (using KDE 4.6.2) OS: Linux If one hovers a JPG2000 image in e.g. dolphin with the information panel open kio_thumbnail will start to consume a lot of CPU and never stop doing so. To reproduce: Use digikam to save a picture as JPG2000, open dolphin and hover the file. It seems Gwenview is affected by the same issue since it also starts to use a lot of CPU while trying to generate a thumbnail. To try that simply open an image with gwenview from the folder where the JPG2000 is in and watch gwenview trying to generate the thumbnail for its preview pane. Reproducible: Always
KDE uses JasPer library to load JPEG 2000 image, so you should report the problem to JasPer developers at http://en.wikipedia.org/wiki/JasPer This library is very slow to begin with. A similar (but incompatible) PGF format can be loaded about 10 times faster, according to its designers, see http://www.libpgf.org/ There is, however, possible room for optimization in the thumbnail loader. It could load a smaller resolution, instead of the full image, similar to what the JPEG loader does. I have yet to investigate if we need a special JPEG 2000 thumbnailer, or if changes in kimgio loader are sufficient.
There are no previews available for PGF in KDE, see bug 273351. Is libjasper really that slow that it takes one whole CPU for > 10 minutes to generate a thumbnail from a picture with the filesize of ~7 MB?
How large is that image? The file size is not really that significant, but image dimensions are. Since JPEG 2000 processes images both horizontally and vertically, you get millions of cache misses/flushes when processing large images. Can you install not only the JasPer library, but also its accompanying command line tools, and convert that file to (say) PNM format and compare the timings? The command is: jasper -t jp2 -f inputimage.jp2 -T pnm -F outputimage.pnm
Ok. I tried the command above and it takes ~9 seconds to convert the image. Its dimensions are 2736x3648 pixel. Creating a thumbnail with kio_thumbnail takes a lot longer measured from its time of high cpu usage before it displays the thumbnail. kio_thumbnail takes > 2 minutes when I hover the picture in dolphin.
Confirmed for KDE 4.8.4 on Kubuntu (but the problem exists much longer, as it is said above).
Git commit e96bd5e148ba163137bf0dbefd2c41652c0fb8d1 by Christoph Feck. Committed on 25/10/2012 at 03:52. Pushed by cfeck into branch 'KDE/4.9'. Fix performance issue with JPEG-2000 loader Instead of reading each component value individually, convert complete rows to a temporary matrix, and fetch the values from there. Additionally, make sure the QImage allocation succeeds. FIXED-IN: KDE 4.9.3 M +30 -3 kimgio/jp2.cpp http://commits.kde.org/kdelibs/e96bd5e148ba163137bf0dbefd2c41652c0fb8d1