在我们的 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/