Summary: | JPG2000 image makes kio_thumbnail hog the CPU forever | ||
---|---|---|---|
Product: | [Unmaintained] kdelibs | Reporter: | S. Burmeister <sven.burmeister> |
Component: | kimgio | Assignee: | Christoph Feck <cfeck> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | adaptee, kollix, nicodorn |
Priority: | NOR | ||
Version: | 4.8.4 | ||
Target Milestone: | --- | ||
Platform: | openSUSE | ||
OS: | Linux | ||
Latest Commit: | http://commits.kde.org/kdelibs/e96bd5e148ba163137bf0dbefd2c41652c0fb8d1 | Version Fixed In: | 4.9.3 |
Sentry Crash Report: |
Description
S. Burmeister
2011-05-16 11:10:41 UTC
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 |