Preview v2 - #293
Conversation
Only src/common/structs.py and src/modules/gui.py were changed
Otherwise, they would remain downloaded, but never be shown To keep thinsg simple just remove extraneous previews
While checking the preview, I discovered a small issue: the image was fixed at a 240:260 pixel ratio, so in comics (for example) with its vertical 4:3 aspect ratio it appeared "stretched." Now all previews (squared, vertical ones) display normally and logically. But needs futher testing with other extraordinary aspect ratios
|
Made some slight improvements on previews dimensions and "stretched" images fix, see description for details |
|
I figured out how to save disk space, albeit with a slight (hopefully) impact on preview loading speed. To do this, I dug deeper into what takes up the most disk space and discovered that GIFs take up the bulk of it. So, what i propose (feel free to adjust/correct my approach): For Images: For GIFs: Such implementation only works for previews, for the full image/video (click to expand) I will think of another method |
|
the main reason i had changed the way you sized previews was looks and consistency. it would create a fixed height bar, but the images inside it were themselves different heights, with some being stretched. it should be that either each image is displayed with fixed aspect ratio and cropped, or each image is displayed at an appropriate size for its aspect ratio. rather than what you made here, i think a better compromise is having a fixed height but varying width of each preview, so they do not get stretched or cropped but also look nice and fill the space well. i just implemented this on main branch with ae1081a, please give it a try and let me know if you still feel sizing needs more tweaks, otherwise personally i think this is quite satisfactory and i'm leaning towards closing this pr. i tested this new variant and it works quite well with both horizontal, square and vertical images imo. about further improvements to preview system overall, im open to them of course (but please dont feel obligated to work on anything, should be on a want to do basis). if you do, ofc open a new pr for them; i ask that you kindly make new changes based off of the main branch: as you see, the commit history for this pr kept the commits from the previous pr, as you created this new branch basing off of the previous branch instead of the updated main branch with changes merged. this gets messy quick, so new prs should be based off of main branch without dangling commits from prior prs. it seems youre making edits directly via github web ui, in this case you should be able to go to the branch list, click new branch, choose as source WillyJL/F95Checker repo and main branch. this will set you up with an updated branch to make new edits in |
|
about saving disk space: im not a huge fan of reducing quality of the previews on disk. the next change i was looking to implement myself was a way to click on a preview to maximize it, and cycle through all previews, with ability to zoom further in aswell; if previews are downscaled to lower quality once downloaded, this feature would suffer from it. i am very much open to more efficient ways of storing the images though. it is true that gifs are terrible for space efficiency. but it'll be tricky. for still images:
for gifs:
|
|
fwiw, i played around a bit with webm: what im seeing with the question that remains to be answered, is how to convert to/from webm/vp9. ffmpeg is always an option, but its a bit of a long way around to get the raw pixel data we want in memory, since ffmpeg primarily works on files. theres opencv which might work for decoding. for encoding ffmpeg is still probably the best solution. but... that would mean:
thats a bit much to bundle into f95checker... idk and there is still the unknown of how much time it will take to load gifs like this: opencv like this is cpu only, so it wouldnt take advantage of gpu acceletared decoding. |
Okay, maybe I don't have much preview examples to differentiate each aspect ratio in one game, but for me horizontal and squared previews looked consistent. But I'll look on the branch you provided, thanks
It's totally on my want to do basis, and thanks for mentioning opening a new pr for that, l'm new to this Github thing
I also thought about saving without destructive methods. For me the process looks that way of doing it:
40-50mb for ffmpeg Well, yep, with this task for now I can't propose something more promising, for now I only know ffmpeg as a primary solution for all encoding purposes. Maybe there is a way to make it lighter in size, but for now taking up 100-150 mb to save more space in the long run would be more beneficial
That's why I decided in the first place to implement it to see the results. But with commit history here I don't wanna mess the progress with basis, so I'll create a new branch and pull request for this, thanks again for pointing that up |
|
I looked into this a bit more, and I don't think OpenCV would actually be necessary here. |
|
That does sound like a good solution, I'm very curious how it will perform |
|
closing as mentioned earlier |
Decided to work further with this preview implementation and slightly improve it, but preserve base implementation while you adding and connecting it to future release. If you like the changes made here you can merge them, just notify me and I'll update it from draft to pull request