如何使用滑行下载存储在Firebase中的图像的缩略图 [英] How to download thumbnails of images stored in firebase using glide

查看:80
本文介绍了如何使用滑行下载存储在Firebase中的图像的缩略图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从我的Firebase存储中下载图像缩略图而不是整个图像.我正在使用滑行来加载图像,但是我无法获得如何加载图像缩略图的方法,因为它更快,存储效率更高.

I want to download the images thumbnail not the entire image from my firebase storage. I am using glide to load the images but i am not getting how can i load image thumbnails as it will be quicker and memory efficient.

推荐答案

您首先需要为图像创建缩略图,可能使用类似 Google云功能 Google App Engine .您可以编写一个获取原始图像的函数,并通过 ImageMagick 运行该函数,然后将其保存回Firebase Storage的已知位置,例如 images/myImage_resized_< height> _< width> png ,您的客户端可以随后获取该信息.

You first need to create thumbnails for the images, likely using something like Google Cloud Functions or Google App Engine. You can write a function that takes the original image, and runs it through ImageMagick, then saves it back to Firebase Storage at a known location, say images/myImage_resized_<height>_<width>.png, which your client can then fetch.

或者,您可以使用Imgix或Cloudinary为Firebase Storage中存储的较小图像提供服务,方法是为这些服务提供下载URL并从那里获取图像.如果您愿意做更多的工作,则Google App Engine提供了 App Engine图片API 是免费的,它可以做很多相同的事情.

Alternatively, you can use Imgix or Cloudinary to serve smaller images stored in Firebase Storage by providing our Download URLs to those services and fetching the images from there. If you're willing to do some more work, Google App Engine offers the App Engine Images API for free, which does many of the same things.

这篇关于如何使用滑行下载存储在Firebase中的图像的缩略图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆