mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-24 10:52:49 +00:00
kimgio: save and restore position from HDRHandler::canRead()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
98ac510ec9
commit
3a29212314
1 changed files with 7 additions and 3 deletions
|
@ -245,6 +245,8 @@ bool HDRHandler::canRead(QIODevice *device)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
qint64 oldPos = device->pos();
|
||||||
|
|
||||||
int len;
|
int len;
|
||||||
char line[MAXLINE];
|
char line[MAXLINE];
|
||||||
bool validHeader = false;
|
bool validHeader = false;
|
||||||
|
@ -265,7 +267,9 @@ bool HDRHandler::canRead(QIODevice *device)
|
||||||
}
|
}
|
||||||
linecount++;
|
linecount++;
|
||||||
} while (linecount < 10);
|
} while (linecount < 10);
|
||||||
|
|
||||||
|
device->seek(oldPos);
|
||||||
|
|
||||||
if (!validHeader || !validFormat) {
|
if (!validHeader || !validFormat) {
|
||||||
kDebug(399) << "Unknown HDR format.";
|
kDebug(399) << "Unknown HDR format.";
|
||||||
return false;
|
return false;
|
||||||
|
@ -276,12 +280,12 @@ bool HDRHandler::canRead(QIODevice *device)
|
||||||
|
|
||||||
QStringList HDRPlugin::keys() const
|
QStringList HDRPlugin::keys() const
|
||||||
{
|
{
|
||||||
return QStringList() << "hdr" << "HDR";
|
return QStringList() << "hdr";
|
||||||
}
|
}
|
||||||
|
|
||||||
QImageIOPlugin::Capabilities HDRPlugin::capabilities(QIODevice *device, const QByteArray &format) const
|
QImageIOPlugin::Capabilities HDRPlugin::capabilities(QIODevice *device, const QByteArray &format) const
|
||||||
{
|
{
|
||||||
if (format == "hdr" || format == "HDR")
|
if (format == "hdr")
|
||||||
return Capabilities(CanRead);
|
return Capabilities(CanRead);
|
||||||
if (!format.isEmpty())
|
if (!format.isEmpty())
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Add table
Reference in a new issue