-
Notifications
You must be signed in to change notification settings - Fork 3
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
Shrink thumbnails on server side #16
Comments
I use imagemagick to do this locally all the time.
The It will add some more dependecies (imagemagick, libmagickcore-dev, libmagickwand-dev) but we can shrink the images if the libraries exist and leave them huge otherwise. also, this reference |
Totally. I want to think about it carefully before we create any temp files. I'm thinking there should be a cache directory that holds both transcoded files and shrunken images. When a transcode or thumbnail is requested, if it's already cached, that gets sent as a static file; otherwise it's created on the fly and also saved in the cache. When the cache exceeds a total size, the file that hasn't been requested in the longest amount of time is deleted. Do you know any readymade solutions for this? It's basically what Memcached does, but that only handles blobs up to 1 MB, big enough for thumbnails, but not for audio tracks. |
Redis comes to mind since that's always mentioned in the same breathe as memcached. would you actually want to hold transcoded audio in memory? Seems like storing the path to the transcoded file and the time it was created/last used would be what we want. In this scenario, does "cached" mean the file is saved as |
Yes, that's what I mean... a cache on disk. |
The cache dir added in 4481460 could be used for this. |
When displaying albums in search results, Pots, fyi downloads the full size album artwork (which in some cases can be like 1600x1600 and 3MB), only to display it as a 50x50 thumbnail.
The server should create a 50x50 version before sending, possibly at a new endpoint like
/albumart/<id>/thumb
.The text was updated successfully, but these errors were encountered: