https://bugs.kde.org/show_bug.cgi?id=454206

--- Comment #19 from Mirco Miranda <mirco...@gmail.com> ---
(In reply to Martin Kyral from comment #17)
> Thanks for working on this problem. Just to clarify: almost all raw formats
> contain actually two jpg previews: the 160x120 thumbnail (which is not
> usable even as a thumbnail now) and larger jpg preview which is either
> full-res (Nikon, Canon... ) or with reduced size but still enough for casual
> viewing (it is what you see at the back display of the camera when reviewing
> images). You need to get the correct (larger) one from the raw file.

We merged MR !299
(https://invent.kde.org/frameworks/kimageformats/-/merge_requests/299). It will
be included in KF 6.11. 
You can set the quality parameter to 0 to load the preview.

You can do it with something like this:

QImageReader ir("fileraw.rawsuffix"); // e.g. "image.cr3"
ir.setDecideFormatFromContent(true); // needed
if (ir.format() == QByteArray("raw")) {
   ir.setQuality(0); // read preview
}
QImage img;
ir.read(&img);

Note that the quality parameter is normally dedicated to writing. Here it was
used as a hack to set parameters to libRAW. To know all the possibilities see
the plugin header:
https://invent.kde.org/frameworks/kimageformats/-/blob/master/src/imageformats/raw_p.h

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to