Bug 327124 - Add loadHalfPreview reading from QBuffer
Summary: Add loadHalfPreview reading from QBuffer
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Plugin-DImg-RAW (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-04 12:18 UTC by Martin Kyral
Modified: 2013-11-04 12:57 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 4.0.0


Attachments
proposed patch (9.96 KB, patch)
2013-11-04 12:18 UTC, Martin Kyral
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Kyral 2013-11-04 12:18:41 UTC
Created attachment 83331 [details]
proposed patch

During implementation of the RAW preview support in gwenview, a need for loadHalfPreview able of loading the RAW data from QBuffer and returning JPEG data in QByteArray arose.
I decided to implement variants of loadHalfPreview and loadRawPreview returning data in a QByteArray (JPEG format, but it would be easily implementable to allow passing the desired format as optional parameter for loadHalfPreview. In loadRawPreview that would be senseless as loadEmbeddedPreview is always JPEG).

If this API change is not desired, I'll implement loadHalfPreview(QImage, QBuffer) as a minimal variant, leaving the conversion to JPEG in QByteArray on gwenview side.

Proposed patch is attached (fixing some typos in the documentation comments, too).

+++ This bug was initially created as a clone of Bug #326953 +++

During implementation of the RAW preview support in gwenview, a need for loadEmbeddedPreview able of loading the RAW data from QBuffer (not file) arose. Temporarily, I've implemented the function within gwenview. For the sake of better maintainability of the code it would be nice to have this feature implemented directly in libkdcraw. Proposed patch is attached.

Reproducible: Always
Comment 1 caulier.gilles 2013-11-04 12:57:51 UTC
Git commit af8aef2c6acc93ea53c1e520fe125656902d6d9f by Gilles Caulier.
Committed on 04/11/2013 at 12:55.
Pushed by cgilles into branch 'master'.

apply patch #83331 to add new method to get load RAW preview from QBuffer
FIXED-IN: 4.0.0

M  +2    -2    CMakeLists.txt
M  +50   -17   libkdcraw/kdcraw.cpp
M  +32   -12   libkdcraw/kdcraw.h
M  +58   -4    libkdcraw/kdcraw_p.cpp
M  +2    -0    libkdcraw/kdcraw_p.h

http://commits.kde.org/libkdcraw/af8aef2c6acc93ea53c1e520fe125656902d6d9f