问题描述
我需要下载非常大5MB +图像。
I need to download images that are very large 5mb+.
据我所知显示,以节省手机内存,但下载一个大的图像仍然问题之前缩放图像的。
I am aware of scaling the image before displaying it to save phone memory but the problem of downloading a large image still remains.
如何下载,也就是说,图像的50%缩小版,而不是下载一个完整的图像,然后缩放呢?
How can I download, say, a 50% scaled down version of an image rather than downloading a full image then scaling it?
推荐答案
必须是由你下载服务器支持。
It must be supported by the server from which you download.
如果该服务器是不是你的,你需要查看该服务器的文档(或反向工程)。
If the server is not yours, you need to look up that server's documentation (or reverse-engineer).
如果服务器是你的,这取决于使用的技术。查找您正在使用特定的服务器端技术的图像处理库。
If the server is yours, it depends on the used technology. Look up an image manipulation library for that particular server-side technology you are using.
在imgur.com,
in case of imgur.com,
看这里:
Imgur您可以利用每个IP每小时500电话,或1000,如果你注册。上传数十倍。
Imgur lets you make 500 calls per hour per IP, or 1000 if you are registered. Uploads count tenfold.
有关的图像元数据被记录在这里:。无论是访问 api.imgur.com/2/image/ [散列]的.xml
或 api.imgur.com/2/image/ [散列]以.json
,并挑选无论是 image.links.small_square
(90x90)或 image.links.large_thumbnail $ C从响应$ C>(?X640)。需要注意的是imgur还生成缩略图(160x160的),它的主页。对于这些网址似乎是
i.imgur.com/ [散列] B.JPG
The metadata about an image is documented here: http://api.imgur.com/resources_anon#image_hash . Access either api.imgur.com/2/image/[hash].xml
or api.imgur.com/2/image/[hash].json
, and pick either image.links.small_square
(90x90) or image.links.large_thumbnail
(?x640) from the response. Note that imgur also generates thumbnails (160x160) for its home page. URLs for these seem to be i.imgur.com/[hash]b.jpg
到大图片的链接 i.imgur.com/ [散列] .JPG
,所以如果你的链接的http:// i.imgur.com/xDpEF.jpg
或 http://imgur.com/xDpEF
,那么 xDpEF
是你需要的哈希值。
The link to the large image is i.imgur.com/[hash].jpg
, so if your link is http://i.imgur.com/xDpEF.jpg
or http://imgur.com/xDpEF
, then xDpEF
is the hash you need.
这篇关于如何下载缩小图像的版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!