mirror of
https://invent.kde.org/frameworks/kimageformats.git
synced 2025-06-03 17:08:08 -04:00
RAW: Fixed unnecessary image unpack
Backport of MR !254 (According to the libraw documentation, the sizes are available directly after open_datastream.) One benefit is that it doubles the speed of preview creation in Dolphin.
This commit is contained in:
parent
f9f29304d8
commit
4168c46964
@ -807,13 +807,11 @@ QVariant RAWHandler::option(ImageOption option) const
|
|||||||
rawProcessor->imgdata.rawparams.shot_select = currentImageNumber();
|
rawProcessor->imgdata.rawparams.shot_select = currentImageNumber();
|
||||||
#endif
|
#endif
|
||||||
if (rawProcessor->open_datastream(&stream) == LIBRAW_SUCCESS) {
|
if (rawProcessor->open_datastream(&stream) == LIBRAW_SUCCESS) {
|
||||||
if (rawProcessor->unpack() == LIBRAW_SUCCESS) {
|
|
||||||
auto w = libraw_get_iwidth(&rawProcessor->imgdata);
|
auto w = libraw_get_iwidth(&rawProcessor->imgdata);
|
||||||
auto h = libraw_get_iheight(&rawProcessor->imgdata);
|
auto h = libraw_get_iheight(&rawProcessor->imgdata);
|
||||||
// flip & 4: taken from LibRaw code
|
// flip & 4: taken from LibRaw code
|
||||||
v = (rawProcessor->imgdata.sizes.flip & 4) ? QSize(h, w) : QSize(w, h);
|
v = (rawProcessor->imgdata.sizes.flip & 4) ? QSize(h, w) : QSize(w, h);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
d->rollbackTransaction();
|
d->rollbackTransaction();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user