This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Dolphin will not preview jpg image files [SOLVED]

Tags: None
(comma "," separated)
freininghaus
Moderator
Posts
224
Karma
1
OS
First of all, I'm not really familiar with the thumbnailing code in kdelibs/kde-runtime either. When looking at the source of KIO::PreviewJob, I get the impression that PreviewJobPrivate::startPreview() determines the MIME type of the file using KFileItem::mimeType(). AFAIK, that function does the following:

1. Look at the extension and see if the mime type can be determined unambigously from that.
2. If that is not the case, check the contents of the file.

If a file with the extension .jpg is found, it will probably not examine the file contents to check the type.

I'm not sure if and how this could/should be fixed. One obvious way would be to make KFileItem::mimeType() *always* examine the file contents. But considering how much disk activity this would use (not only when creating previews, but also in many other situations), I think that this would not be a good solution. Another option would be to do that only if creating the preview using the "guessed by extension" type failed. However, I don't think there is any API for determining the MIME type by "contents only" in KDE 4.x. AFAIK, Qt 5 has QMimeDataBase which could be used for that, see http://doc-snapshot.qt-project.org/5.0/ ... hMode-enum . But then one could argue that this is a Digikam bug, so I'm not sure if a suggestion to make KIO::PreviewJob considerably more complex to work around that would be met with great enthusiasm.


Bookmarks



Who is online

Registered users: Bing [Bot], gfielding, Google [Bot], markhm, sethaaaa, Sogou [Bot], Yahoo [Bot]