firebase / extensions

Source code for official Firebase extensions
https://firebase.google.com/products/extensions
Apache License 2.0
888 stars 374 forks source link

🐛 [storage-resize-images] Extension crops the image with default settings. #2106

Open mehmet2006 opened 4 months ago

mehmet2006 commented 4 months ago

[READ] Step 1: Are you in the right place?

Issues filed here should be about bugs for a specific extension in this repository. If you have a general question, need help debugging, or fall into some other category use one of these other channels:

[REQUIRED] Step 2: Describe your configuration

[REQUIRED] Step 3: Describe the problem

In the documentation it says, it will keep the aspect ratio when resizing images. But currently it doesn't. It crops the image

Steps to reproduce:

1- Install the extension 2- Add 300x300, 756x756, 900x900 image resolutions 3- What the installation finished 4- Upload an image 5- Check the results

Expected result

Images should have been resized with the same aspect ratio and crop should have happen

Actual result

Images lost their aspect ratio and and it is cropped

gregives commented 3 months ago

@mehmet2006 did you find a workaround for this? I'm also experiencing the same problem!

gregives commented 3 months ago

I've submitted a pull request to fix this issue. If anyone needs a workaround in the meantime, change this setting in the configuration of the extension.

Sharp constructor options for resizing images

{ "fit": "inside" }