-
Notifications
You must be signed in to change notification settings - Fork 160
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Thumbnails #1262
Draft
leejuyuu
wants to merge
19
commits into
nomacs:master
Choose a base branch
from
leejuyuu:thumbs
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Thumbnails #1262
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Closed
The byte array parameter of this function is always empty. Remove it for simplicity.
- Return early if scaling is not needed in DkImage::createThumb - Change duplicated code in DkThumbNail::computeIntern into DkImage::createThumb call. - Remove unused maxThumbSize parameter of DkThumbNail::computeIntern - Remove unused mMaxThumbSize member of DkThumbNail
- Remove the unused forceLoad flag of DkThumbNail::compute() - Absorb common DkImage::createThumb() call into DkThumbNail::computeIntern(). - Use the QtConcurrent::run() feature to pass arguments instead of using lambda. The copying is handled by Qt.
This is part of the effort to move DkThumbNailT out of DkImageContainer. The widgets that needs thumbnails should make their own. - Add function to create DkThumbNailT from DkImageContainer because the creation accesses internal state for zip files. - Create the DkThumbNailT inside DkThumbSaver instead of using DkImageContainer::getThumb(). - Remove the excess DkThumbSaver::loadNext call
This is part of the effort to move DkThumbNailT out of DkImageContainer. The widgets that needs thumbnails should make their own.
- Remove the confusing icon variable - Return early if input is invalid, specify empty initializer
This is part of the effort to move DkThumbNailT out of DkImageContainer. Get the icon for the tab bar from the actual image instead of the DkThumbNailT. This does not change the behavior because DkImageContainerT::loadingFinished writes the loaded image to the DkThumbNailT. Therefore we are still getting the same data. Pass the icon size into getIcon() for caching the scaled image.
Remove the unused mThumb and its getter and setters from DkImageContainer.
Split DkThumbNail::computeIntern into smaller functions to make it easier to understand. Separate the reading and writing part so we can reuse the reading. Remove unnecessary scalings.
Use the loadThumbnail function instead, to reduce the API surface of DkThumbNail.
Originally, the thumbnails were loaded concurrently with DkThumbNailT. However, since the thumbnails we load generally lives in a single directory, i.e. one I/O device, reading the files concurrently probably does not help. Add DkThumbLoader to spawn a thread and accept requests for thumbnails. The requests can be automatically queued by the QueuedConnection. With the queue, we can prioritize reading the files that has EXIF thumbnails and come back to decode the full image for those doesn't later. Place the DkThumbLoader in DkCentralWidget, the lowest common ancestor of the widgets that use thumbnails. Rewrite DkThumbLabel so it uses DkThumbLoader and no longer holds DkThumbNailT. Closes nomacs#648
Thumbnails should be the preview of the files on the disk, so they only update when the edits are written to the file. Do not read thumbnail from the image containers in DkFilePreview. Then we can make the DkFilePreview not dependent on DkImageContainerT. Also gets rid of various syncing issues. Fixes nomacs#663 Fixes nomacs#787 Closes nomacs#1263
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.