Added preview bypass for .gif files #1012
Merged
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.
This PR adds a bypass for the preview generation of GIF files. I noticed gif files use the default gif.Encode function which only processes the first frame, making the whole GIF purpose useless. When previewing gif files right now, they're not animated.☹️
The bypass is only activated for big previews since I thought a bunch of small gif files in a folder view looks silly and is probably not too keen on performance. Also the previews where streched to squares and I didn't want to go down that rabbit hole.
I literally learned Go for this within 2 hours but got it working. After all it's just a simple bypass using another function for gifs. Any feedback and suggestions are greatly appreciated.
I also thought about incorporating the process in the preexisting imgProcessor but it takes multiple seconds(!) to process all frames. I think just handing it out as is, is the better solution here. When you handle gif files you know they're not optimized for size.
Also, maybe this behavior can be hidden behind a settings toggle if desirable. I think previewing gifs in big mode should be animated by default.