I'm trying to create a Google drive android app where I should be able to download resized images from Google drive.
It's kind of a performance issue. Suppose I have uploaded an image of 1080px from my computer, now I wish to download that image to my Android phone which doesn't support 1080px image, so what happens is the image first gets downloaded then it's resized as per my device dimensions. But this is actually wastage of time and data.
Why to download a 1080px image when I can only show may be like 480px or 720px image.
I'm using Google drive api but I would like to know whether there is some parameter or something which we can pass from phone so that we get to download the resized image only.
As per my search, Link
There is this Partial download where I can give a range of bytes but I'm not trying to download a particular portion of a file, I want to download the whole image file in a resized format.
Any ideas, clues will be very helpful.
Thanks
The answer applies to the RESTful Api, since GDAA does not have a 'thumbnailLink' functionality as of today (Feb 14. 2015).
I use this code snippet to download reduced images and thumbnails:
I have a tested it with a few sizes (see the method header), which I snatched from Picasa documentation here.
See, the 'thumbnailLink' has the form of
and by changing the '220' at the end to one of these values:
I managed to pull the image of the requested size (letting the server to reduce it).
DISCLAIMER:
It is not a documented feature, so it is a HACK. I also admit that a more robust version should not rely on finding "s220", but probably "=sNUMBER" patttern. Good luck.