-
Notifications
You must be signed in to change notification settings - Fork 2
Description
Animated images need to be buffered otherwise Roseate will consume a lot of memory and some long duration animated images will never load and they have the possibility of crashing or freezing your system.
I actually mentioned this already in #92:
The GIF problem is further worsened however by us not buffering the frames of animated images (image viewers like GNOME Loupe do this to avoid this very problem of memory spikes).
..but as said we need to stop loading all the frames of an animated image at once and stream it instead in chunks. For example, each chunk could be like 10 GIF frames (we should most likely look at the delay between each frame too to determine the frame count in each chunk), we load the first chunk then the GUI begins displaying that chunk but in the background the next chunk is loaded simultaneously then when that chunk is displayed the last chunk is removed from memory and so on until the animated image sequence is done.
Some large changes will have to be done in the core library and the app for this feature to be implemented and it will have to be implemented in a way we can later take advantage of buffering for when we add a carousel in Roseate for loading and viewing multiple images.
This feature also effects the other animated image formats such as webp, apng and jpeg-xl.