firebase - 使用 firebase resize images extension 动态调整图像大小

标签 firebase firebase-storage image-resizing firebase-extensions

在我们的 Firebase 存储中,我们有宽度为 1080 和不同高度的图像。使用此扩展程序 (https://firebase.google.com/products/extensions/storage-resize-images),我们需要将宽度调整为 480,保持纵横比。如何使用此扩展来实现这一点?它允许我们指定维度,但不是我们需要的。

如果此扩展程序无法做到这一点,有哪些类似的替代方案?

最佳答案

来自 here

For example, say that you specify a max width of 200px and a max height of 100px. You upload an image that is 480px wide by 640px high, which means a 0.75 aspect ratio. The final resized image will be 75px wide by 100px high to maintain the aspect ratio while also being at or under both of your maximum specified dimensions.

我最初也对此感到困惑。总之,您指定的维度是任一维度的最大值;根据纵横比,将使用这些值中的一个或两个,并且纵横比将始终保持不变。

关于firebase - 使用 firebase resize images extension 动态调整图像大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60831732/

相关文章:

ios - 为什么 Firebase 远程配置不更新值?

javascript - 在 React Native 应用程序上检索 Firebase 数据时出现问题

firebase - 函数被杀死。错误 : memory limit exceeded [Thumbnail example]

python - 如何将一个图像垂直切割成两个大小相等的图像

node.js - 将 Google People API 与 Cloud Functions for Firebase 结合使用

java - Android:从 Firebase 数据库中检索特定用户的数据

ios - 将文件上传到 firebase 时正文文件无法访问错误

Firebase - 限制特定用户访问文件

html - CSS:CSS 图像调整大小以适应浏览器

java - 适用于 Android 的 ImageResizer 库