-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
2 channel grey+alpha, resize with non-opaque background: vector must have 1 or 3 elements #2569
Comments
Please can you provide a sample input image and standalone code (e.g. no undefined variables) to allow someone else to reproduce this problem. |
This is the picture I generated with gm, I don’t know why I get an error when I use sharp。 When I remove the resize background, it doesn’t report an error
|
I cannot reproduce this on Linux using the latest sharp v0.27.1 with the input image and sample code provided. I downloaded the sample $ curl -so axxx.png https://user-images.githubusercontent.com/12556069/108620148-020f2d00-7465-11eb-8ca6-70fce9b41757.png It might be that GitHub is altering the image. Please can you provide a standalone repo with a |
year ,it seems github is altering the image, you can try https://github.com/banli17/sharp_test and i use globally-installed libvips v8.10.0 When the color of fill stoke is .fill('#000000') .stroke('#333333'), an error will be reported, and sometimes no error will be reported, such as fill('red') |
Thank you, I can now reproduce this. The input image is 16-bit, 2 channel (grey+alpha) and it fails when the |
This problem relates to sharp's alpha detection, which doesn't currently support 16-bit, 2 channel input. Luckily libvips now provides/exposes a much better |
v0.27.2 now available with the fix. |
I used gm to convert the shadowed text into a picture, and then resize the picture with sharp resize, and it reported an error.
I tried to modify the color of the shadow and found that sometimes an error is reported, such as when the shadow is #000000. When I change to #040303, no error will be reported.
When I removed the background of sharp resize, I found that no error was reported. But I need transparent text images. Here is the code:
The text was updated successfully, but these errors were encountered: