mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-23 18:32:49 +00:00
kimgio: hardcode RAW image MIME types
the plugin is heavy on I/O already because LibRaw requires the whole file data to determine if it can open it or not so this will reduce that a bit at the cost of (possibly) requiring update in the future Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
97bb978c42
commit
9526e164cb
1 changed files with 18 additions and 11 deletions
|
@ -19,7 +19,6 @@
|
|||
#include "raw.h"
|
||||
|
||||
#include <QImage>
|
||||
#include <kmimetype.h>
|
||||
#include <kdebug.h>
|
||||
|
||||
#include <libraw/libraw.h>
|
||||
|
@ -171,16 +170,24 @@ QStringList RAWPlugin::keys() const
|
|||
|
||||
QList<QByteArray> RAWPlugin::mimeTypes() const
|
||||
{
|
||||
static QList<QByteArray> list;
|
||||
if (list.isEmpty()) {
|
||||
foreach (const KMimeType::Ptr &mime, KMimeType::allMimeTypes()) {
|
||||
// NOTE: RAW MIME types are sub-class of image/x-dcraw
|
||||
if (mime && mime->is(QString::fromLatin1("image/x-dcraw"))
|
||||
&& mime->name() != QLatin1String("image/x-dcraw")) {
|
||||
list.append(mime->name().toLatin1());
|
||||
}
|
||||
}
|
||||
}
|
||||
static const QList<QByteArray> list = QList<QByteArray>()
|
||||
<< "image/x-sony-srf"
|
||||
<< "image/x-fuji-raf"
|
||||
<< "image/x-adobe-dng"
|
||||
<< "image/x-olympus-orf"
|
||||
<< "image/x-panasonic-rw2"
|
||||
<< "image/x-kodak-dcr"
|
||||
<< "image/x-kodak-k25"
|
||||
<< "image/x-sony-arw"
|
||||
<< "image/x-minolta-mrw"
|
||||
<< "image/x-kodak-kdc"
|
||||
<< "image/x-sigma-x3f"
|
||||
<< "image/x-nikon-nef"
|
||||
<< "image/x-pentax-pef"
|
||||
<< "image/x-panasonic-rw"
|
||||
<< "image/x-canon-crw"
|
||||
<< "image/x-sony-sr2"
|
||||
<< "image/x-canon-cr2";
|
||||
return list;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue