(2012-06-04, 16:55)Montellese Wrote: Yes after Eden jmarshall has changed the way XBMC caches images. They are now referenced with an URI of the following schema:
Code:
image://<url encoded uri from where the image originally came>
and that's also what you should get through JSON-RPC. You should still be able to URL-encode the whole image URI you get through JSON-RPC and call http://<ip>:<port>/vfs/<url encoded image path> but you should switch to using http://<ip>:<port>/image/<url encoded image path> which (in the future) will provide additional functionality like automatic image resizing during retrieval etc. So basically nothing has changed, the returned URIs just look different.
I'm trying the yesterday alpha and it seems there's some speed problems.
This request on same numbers of movies ( Request : {"id":1,"jsonrpc":"2.0","method":"VideoLibrary.GetMovies","params":{"properties":["director","genre","plot","rating","runtime","sorttitle","studio","thumbnail","title","trailer","playcount","year"]}}) takes like 1 sec more (around 1000 movies)
And the very most annoying part the image download are slowwwwwwwwwwwwwwwwww (i still use the /vfs).
Image takes like 10 time more times to download on android perhaps more.
I use optimizations that should only download the file header then download the file in an optimised way for target small resolution
Don't really know what it does with webserver but worked perfect before Frodo.
The used code : (Image size is 240 for my batch downloads of thumbs).
Code:
private Bitmap downloadImage(ImageInfo image, int ImageSize) {
Bitmap b = null;
try {
InputStream is;
int scale = 1;
// Decode image size
if (ImageSize > 0) {
BitmapFactory.Options o = new BitmapFactory.Options();
o.inJustDecodeBounds = true;
is = getImageStream(image, NETWORK_TIMEOUT);
BitmapFactory.decodeStream(is, null, o);
is.close();
is = null;
if (o.outHeight > ImageSize || o.outWidth > ImageSize) {
scale = (int) Math.pow(
2,
(int) Math.round(Math.log(ImageSize
/ (double) Math.max(o.outHeight, o.outWidth))
/ Math.log(0.5)));
}
}
// Decode with inSampleSize
BitmapFactory.Options o2 = new BitmapFactory.Options();
if (ImageSize > 0) {
o2.inSampleSize = scale;
}
o2.inJustDecodeBounds = false;
o2.inDither = true;
o2.inScaled = false;
o2.inPreferredConfig = Bitmap.Config.RGB_565;
is = getImageStream(image, NETWORK_TIMEOUT);
b = BitmapFactory.decodeStream(is, null, o2);
is.close();
is = null;
} catch (Exception e) {
if (Logger.LOG_WARN)
Logger.LogWarning(TAG, "Exception : " + e.getMessage());
}
return b;
}