extensions icon indicating copy to clipboard operation
extensions copied to clipboard

"Resize Images Extension" not handling grayscale images properly

Open huangjeff5 opened this issue 3 years ago • 0 comments

[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:

  • For general technical questions, post a question on StackOverflow with the firebase tag.
  • For general Firebase discussion, use the firebase-talk google group.
  • To file a bug against the Firebase Extensions platform, or for an issue affecting multiple extensions, please reach out to Firebase support directly.

[REQUIRED] Step 2: Describe your configuration

Create a new project and enable the Resize Images extension with default configuration values. Upload any grayscale image with an embedded ICC profile to Storage, the resized image will have compression artifacts.

[REQUIRED] Step 3: Describe the problem

Resize Images extension can't properly handle photos with an embedded ICC profile creating a lot of compression algorithms during the resize process. This is a known issue reported on the Sharp library github page (https://github.com/lovell/sharp/issues/3112). The solution is to update the Sharp version to version >=0.30.2.

The current workaround is to edit the source of the extension and the files package.json and package-lock.json. to use the 0.30.2 version and deploying the function. I implemented this in my internal test project ks-test-61539 (940703108231).

Steps to reproduce:

What happened? How can we make the problem occur? This could be a description, log/console output, etc.

I found this image on wikipedia (https://upload.wikimedia.org/wikipedia/commons/6/6a/Acapulco_Golds_ad.jpg) with a different grayscale colour profile that produces the same artifacts.

huangjeff5 avatar Jul 20 '22 15:07 huangjeff5