Sry, I should really enable Kate's spell checking.
Thanks in advance for fixing this minor typo.
Docs updated. Need to apply https://phabricator.kde.org/D21329 first, to avoid conflict.
Perfect, thanks. Works fine and seems like an appropriate solution. Please fix a typo in the comment and then this is good to go!
I really can't get used to high quality thumbnails. The problem with your approach is that it puts (IMO unnecessary) load on memory bus and CPU: First we would crawl through all files in the directory to quickly display the embedded thumbnail and in a second run we open and decode picture by picture just for generating nice high quality thumbs. This reminds me of https://bugs.kde.org/show_bug.cgi?id=331435
I just followed the steps to repeat described in the bug, i.e. create an empty file: touch test.jpg
I think blurry is better than pixellated.
Thanks, this makes sense. Is there an easy way to force thumbnail generation to fail for an image to test this?
P.S.: The unit test fails expectedly. However, I'd first like to get some feedback before fixing it.
Attached is a screenshot demonstrating this suggestion. Even at 512px big thumbs, the embedded thumbnail (160x120) is big enough to get a rough idea of what's on the picture: A landscape, an animal, maybe which one? (not sure if you can tell the difference between a horse and a donkey, but IMO this isn't the purpose of a thumbnail preview anyway.)
Example Canon thumbnail attached:
Tue, May 21
My bad, sorry. I should have done a closer code review. Fixed with 3a5cd96bfc92741e6fb6285b516934ffb76ae56f.
There are still code styling issues, but too late...
Thanks very much!
Unit test fixed. Unfortunately I can't avoid QFile::readAll() entirely. When the same file is saved as the one already open through mem-mapping, we are in trouble when writing to that file: "It is unspecified whether modifications made to the file made after the mapping is created will be visible through the mapped memory." Apparently this might be the case and causes strange behavior when working with the input data later on. And I can't simply unmap the input data, as it may be needed for transformation. Thus postpone QFile::readAll() to JpegContent::save(). At least it speeds up the thumbnail generator.
Mon, May 20
Thanks very much! However this patch makes the jpegcontenttest crash. Looks like it needs some adjustment to account for your changes.
Sun, May 19
Use private mapping and handle nullptr.
Sat, May 18
Also, please use MapPrivate.