Posts: 5,184
Joined: Jan 2009
Reputation:
131
It's something we want but nobody has ever done it.
Always read the
online manual (wiki),
FAQ (wiki) and search the forum before posting.
Do not e-mail Team Kodi members directly asking for support. Read/follow the
forum rules (wiki).
Please read the pages on
troubleshooting (wiki) and
bug reporting (wiki) before reporting issues.
Posts: 30
Joined: Jan 2014
Reputation:
0
Is there any reason behind that?
I just developped a small plug in on wy webserver to do it and cache it, but I don't like having to pass through another service/computer to do so
Posts: 5,184
Joined: Jan 2009
Reputation:
131
Because in most cases you eill request the resized image multiple times and resizing it on request every single time is very ineficient (especially on low-power hardware). But we also can't cache every resized image in xbmc because that would take up a lot of space.
Therefore we need to find a middle way where we define fixed widths or heights that are available and can be kept in the cache. But there was no real consensus on thst.
Always read the
online manual (wiki),
FAQ (wiki) and search the forum before posting.
Do not e-mail Team Kodi members directly asking for support. Read/follow the
forum rules (wiki).
Please read the pages on
troubleshooting (wiki) and
bug reporting (wiki) before reporting issues.
Posts: 3,077
Joined: Jun 2009
For me it's client responsibility to manage cache of re-sized images.
You just need to provide correct HTTP cache headers and 304 answers based on change of original image cache.
Just talking from my side but dealing with Android devices with 6 different possible DPI so 6 different size for the same image in the same screen depending on phone, means if size are limited on server side they won't be very useful.
Posts: 3,077
Joined: Jun 2009
IMO, for fixed size on XBMC side but not ending with hardcoded values on clients that could change over time, solution would be to have some kind of contract like I ask for an image size and XBMC sends back an image that is known to be the smallest possible but yet equals or bigger than the one asked.
For caching, it's never the job of webserver to keep track of anything. You just need correct headers with default values about cache and should use for example etag to compare and return 304 or not depending on the case.
For a best result it would be cool to store the cache value of source server about an image when downloaded from internet but is really not mandatory to have something that works.
Posts: 4,549
Joined: Dec 2007
Reputation:
17
topfs2
Team-Kodi Developer
Posts: 4,549
We could implement a kind of round robin harddrive cache for scaled images. However I agree that in general we should be able to trust the client to cache them. Web browsers are very good at it for example, I guess we just need to set the proper headers for it.
If you have problems please read
this before posting
Always read the
XBMC online-manual,
FAQ and
search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the
forum rules.
For troubleshooting and bug reporting please make sure you
read this first.
"Well Im gonna download the code and look at it a bit but I'm certainly not a really good C/C++ programer but I'd help as much as I can, I mostly write in C#."
Posts: 6,255
Joined: Jun 2009
Reputation:
115
da-anda
Team-Kodi Member
Posts: 6,255
we also need a garbage collector for cached images and textures. Having such a gc I don't think disc size would be much of an issue - it's not like one is using 20 different remote client apps wich all require different sizes
Posts: 1,832
Joined: Nov 2010
Reputation:
58
IMHO in 2014 resizing and caching an image on the client side seems a reasonable thing to do without any extra efforts on the xbmc server side.
Posts: 3,077
Joined: Jun 2009
Even in 2014, 100% of 3G / 4G provides does set bandwidth caps and limitations.
So as I said 100% agree caching should be done on client and should not be done on XBMC, but re-sizing have interest for lots of user cases. Download full HD fanarts to display them on a 3.5'' phone is not efficient
Posts: 5,184
Joined: Jan 2009
Reputation:
131
I've made a PR for above changes, see PR5573.
Always read the
online manual (wiki),
FAQ (wiki) and search the forum before posting.
Do not e-mail Team Kodi members directly asking for support. Read/follow the
forum rules (wiki).
Please read the pages on
troubleshooting (wiki) and
bug reporting (wiki) before reporting issues.