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
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