Review Request 113397: RAW preview in gwenview

Martin Kyral martin.kyral at gmail.com
Wed Oct 23 16:47:41 UTC 2013



> On Oct. 23, 2013, 1:20 p.m., Aurélien Gâteau wrote:
> > Some meta changes:
> > - please subscribe the "gwenview" reviewboard group.
> > - you can set the bug report number in the review info as well.
> > - branch should be master: such a new feature cannot be merged into 4.11.
> > 
> > Some general style remarks:
> > - Add a space after "#include" and after "if".
> > - Do not prefix local variables with 'm'. This prefix is used to indicate member variables.

Thanks for your input. I fixed the style remarks. It will be part of v2. Would it be better to upload new (cumulative) patch, or additional patch?


> On Oct. 23, 2013, 1:20 p.m., Aurélien Gâteau wrote:
> > lib/document/loadingdocumentimpl.cpp, line 242
> > <http://git.reviewboard.kde.org/r/113397/diff/1/?file=205132#file205132line242>
> >
> >     This code is duplicated from the "jpeg" block. I suggest doing something like this:
> >     
> >     if (mFormat == "jpeg"...) {
> >         mJpegContent.reset(new JpegContent());
> >     } else if (KDcraw...) {
> >         mJpegContent.reset(new JpegContent());
> >         mData = get_preview_from_data(mData);
> >     }
> >     if (mJpegContent.data()) {
> >         if (!mJpegContent->loadFromData(mData, mExiv2Image.get())) {
> >             return false;
> >         }
> >     
> >         // Use the size from JpegContent, as its correctly transposed if the
> >         // image has been rotated
> >         mImageSize = mJpegContent->size();
> >     
> >         mCmsProfile = Cms::Profile::loadFromExiv2Image(mExiv2Image.get());
> >

thanks for a hint, I have fixed it and the fix will be part of patch v2 (shall it be new patch or additional patch?)


> On Oct. 23, 2013, 1:20 p.m., Aurélien Gâteau wrote:
> > lib/gwenviewconfig.kcfg, line 36
> > <http://git.reviewboard.kde.org/r/113397/diff/1/?file=205133#file205133line36>
> >
> >     The "whatsthis" information needs to be updated as well.

I have fixed it and the fix will be part of patch v2


> On Oct. 23, 2013, 1:20 p.m., Aurélien Gâteau wrote:
> > lib/thumbnailprovider/thumbnailgenerator.cpp, line 61
> > <http://git.reviewboard.kde.org/r/113397/diff/1/?file=205135#file205135line61>
> >
> >     Please remove commented-out code

I have fixed it and the fix will be part of patch v2


> On Oct. 23, 2013, 1:20 p.m., Aurélien Gâteau wrote:
> > lib/thumbnailprovider/thumbnailgenerator.cpp, line 62
> > <http://git.reviewboard.kde.org/r/113397/diff/1/?file=205135#file205135line62>
> >
> >     Why is this needed?

the bytearray containing format hint seems to be mandatory:

(snip from qimagereader.h)
    explicit QImageReader(QIODevice *device, const QByteArray &format = QByteArray());
    explicit QImageReader(const QString &fileName, const QByteArray &format = QByteArray());


> On Oct. 23, 2013, 1:20 p.m., Aurélien Gâteau wrote:
> > lib/thumbnailprovider/thumbnailgenerator.cpp, line 79
> > <http://git.reviewboard.kde.org/r/113397/diff/1/?file=205135#file205135line79>
> >
> >     Shouldn't it "return false" here?

Yep, it should. I have fixed it and the fix will be part of patch v2


> On Oct. 23, 2013, 1:20 p.m., Aurélien Gâteau wrote:
> > lib/document/loadingdocumentimpl.cpp, line 248
> > <http://git.reviewboard.kde.org/r/113397/diff/1/?file=205132#file205132line248>
> >
> >     If I understand it correctly, loadEmbeddedPreview() reads the image at path and extracts the preview in mData. This is not good because:
> >     - We already have the data in mData, so it is read twice
> >     - This likely won't work for remote urls
> >     
> >     Is there a way to get KDcraw to load a preview from the raw data itself?

I have managed to refactor the code so the mData won't be filled twice anymore. Unfortunatelly, KDcraw is file-centric so it won't work for remote urls. There needs to be an if clause ensuring, that the raw functionality won't be used on remote urls.


- Martin


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/113397/#review42211
-----------------------------------------------------------


On Oct. 23, 2013, 1:44 p.m., Martin Kyral wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/113397/
> -----------------------------------------------------------
> 
> (Updated Oct. 23, 2013, 1:44 p.m.)
> 
> 
> Review request for Gwenview and Aurélien Gâteau.
> 
> 
> Repository: gwenview
> 
> 
> Description
> -------
> 
> This is a review of patch enabling raw support in gwenview. It uses KDcraw to extract the embedded jpeg preview (most of the raw formats contain it for the purposes of quick viewing the photos on the camera display) so it is fast, implementing was quite easy and theoretically it enables gwenview to support everything dcraw supports (practically we need to test more formats). The patch does not perform demosaicing and I don't think it shall - digikam, darktable or rawtherapee are much more suited for developing the 'digital negatives'.
> 
> The patch fixes BZ#158788
> 
> The patch enables support for Nikon NEF and NRW formats, Canon's CR2, Pentax PEF, Sony ARW and Adobe DNG. If you want to try another format, just adding it's MIME type to the list in lib/mimetypeutils.cpp shall be enough.
> 
> The patch as is contains just the basic functionality (generating proper thumbnails and viewing the raw images incl. EXIF metadata), but it is well usable. However, there is still a lot of stuff to do (see the commit message in the patch) so I'd appreciate any help.
> 
> 
> Diffs
> -----
> 
>   CMakeLists.txt 4dafb7e 
>   lib/CMakeLists.txt c6ffe14 
>   lib/document/loadingdocumentimpl.cpp fbad8ff 
>   lib/gwenviewconfig.kcfg 231fd5e 
>   lib/mimetypeutils.cpp 546346f 
>   lib/thumbnailprovider/thumbnailgenerator.cpp 8b98904 
> 
> Diff: http://git.reviewboard.kde.org/r/113397/diff/
> 
> 
> Testing
> -------
> 
> Tested on some sample raw files taken from the camera reviews on http://www.photographyblog.com/ and bunch of my own photos. Nikon (tried D50, D70s, D90, D800 and Coolpix P7000), Canon (tried 7D, 5D Mark3 and 6D) and Pentax (K-X, K30) have the preview full-res, while Sony raw files (A900, A850, A58, Nex 3, Nex 6) have only 1616x1050.
> 
> 
> Thanks,
> 
> Martin Kyral
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/gwenview-devel/attachments/20131023/831c24d1/attachment-0001.html>


More information about the Gwenview-devel mailing list