Comments (5)
Hi,
Did some benchmarking and some more research about what you were speaking about with image compression and it can indeed speed up loading times by a significant amount (in fact during my tests I noticed the loading time is exponentially faster the lower the resolution is). So I'll probably fork the main branch in order to work on this feature for the next version of the mod. I think I would leave it optional, because it implies creating "temporary" thumbnail files, which might take space on the user's computer without him knowing about it.
Oh and I figured out why there was a little lag for loading images, it's because you're sorting your screenshots by descending order, and the bug is that it's loading the screenshots in ascending order. I'm pretty sure this will be fixed in the next version (if I don't forget about it).
from screenshotviewer.
For a little more context, I have an OC Ryzen 9 5950X, 24Gb RAM dedicated and PCIe 3.0 NVME TLC SSD. The game runs Fabric 1.20.1 with all most popular optimization mods. Actual for the latest release of Screenshot Viewer.
from screenshotviewer.
Hello,
Thank you for your feedback. When you say "It takes a lot of time to load existing screenshots" ; are you saying that there's a lag when opening the screen? Or that the images take a long time to load? Or maybe just the fact that loading all screenshots are inefficient?
If you experience any real issue, maybe you can send a quick video just so I have better insight into what's going on. I've tried replicating such issues with a high number of images, and it all seemed to load perfectly, maybe it's due to my graphics card, being a RTX 2060.
Regarding your suggestion for thumbnails, it might not be such a good idea. Minecraft uses the library STB_image
in order to load images into the game, and Screenshot Viewer uses it too. And from what I know, there's no method to load any thumbnail/compressed subimage of an image in this library, meaning that an implementation of such a feature would require loading the full size image, compressing it, and caching the compressed version, which requires a lot of operations for a screen that must be reloaded every time it is opened. Screenshot images load asynchronously, and are cached for the whole duration the Manage Screenshots screen is open. That's why I'm pretty skeptical about adding this feature. I'm not convinced it would really perform better.
I'd like to hear your thoughts about this. Have a nice day!
from screenshotviewer.
Thanks for the reply!
There is a lag (stutter), not a huge problem, and a delay on loading and therefore accessing images, which is actually important.
https://github.com/LGatodu47/ScreenshotViewer/assets/74774853/f09b3d13-9606-458e-8b3d-9ef211cca102
My idea is to implement scanning through screenshots folder in minecraft (I'll call it 'source') and comparing existing images with contents of folder with thumbnails ('preview'), which is initially created and empty on first boot with mod.
If the image from source is not detected in preview (by name, for example), then the mod will process one-time compression and saving of this image to preview, then load the image to widget directly from compression buffer. Later, the general reading function (could't find it) will detect existing thumbnails and call general loading function (this too) with thumbnail's path instead of full-size image, so the getImage(screenshotFile) gets a thumbnail's contents.
Once thumbnails are loaded, the other part of mod will begin loading full-size images and open them on user click, just as it does now.
As the situation of thumbnail not representing the original image is rare due to how minecraft saves them, it still would be nice to have a button to repeat the process of compression for each image individually or the entire folder.
I understand that this method may not help with the initial delay (when screenshots are completely empty) or even worsen it by a bit with extra computations, but it definitely should help with faster finishing of IO work and closing threads especially with highres images.
from screenshotviewer.
So glad to hear that! Thank you for your work!
from screenshotviewer.
Related Issues (20)
- scroll area isn't working correctly HOT 2
- 1.20.2 Compatibility? HOT 2
- Fast Delete Feature HOT 3
- please make it so that it is in order HOT 1
- Feature: disable display of screenshot names HOT 3
- Resourcepack support HOT 3
- Menu not following selected screenshot HOT 1
- Zooming in works the wrong way HOT 1
- 1.20.3-4 support HOT 6
- [Compatibility] Resource Packs HOT 2
- 1.18.2 In-Game screenshot preview is reducing white pixels to an ugly gray...? HOT 1
- [feature request]View screenshot in full screen HOT 1
- [Feedback / Feature Request] Make the right click ability more universal and more clearly visible HOT 3
- Screenshot Viewer cant show screenshots on symlinks HOT 1
- crashing when taking a screenshot -optifine 1.20.1 HOT 3
- [Feature request]Added to change position when the title is displayed HOT 2
- 1.21 Support HOT 2
- [Feature request] Add keybind option to open screenshot gui HOT 1
- how to raise the mod icon in Minecraft itself to the main screen
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from screenshotviewer.