Skip to content
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

Image to composite must have same dimensions or smaller. #405

Closed
tmihalik opened this issue Dec 9, 2022 · 6 comments · Fixed by #530
Closed

Image to composite must have same dimensions or smaller. #405

tmihalik opened this issue Dec 9, 2022 · 6 comments · Fixed by #530
Assignees

Comments

@tmihalik
Copy link

tmihalik commented Dec 9, 2022

Hi, we're struggling with this issue long time ago. Couldn't find any answer besides that the issue is more or less known. We use different tricks to bypass it, but would be great to find a permanent solution within Sharp.
The problem occurs when we want to watermark different images. For that we're using the composite function which works great except when the overlaying layer's height is bigger than the original image. Even one pixel of difference makes crush the process, however didn't experience the same problem with widths. I think it would be a solution if the overlaying image would be cropped whenever it's necessary.
Any chance anyone has a proper solution (without changing the ratio)? Or the developers would consider to fix this problem?
Thank you in advance.

@dougtoppin
Copy link
Contributor

@tmihalik We will discuss this and get back to you

@github-actions
Copy link

This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.

@tmihalik
Copy link
Author

tmihalik commented May 1, 2023

Hey, is there anything about this question? I have found a different solution for myself but I think this bug should be important for others.

@dougtoppin
Copy link
Contributor

@tmihalik We are adding this to our backlog now and will let you know when we have a version that supports it.
Thanks for your report.

@dougtoppin
Copy link
Contributor

dougtoppin commented Dec 18, 2023

@tmihalik Could you provide the following information about this issue.
We duplicated what we think you are experiencing, but it would be helpful to confirm.

  • version deployed
  • an example request including the image dimensions where you are experiencing the problem
  • what response the client is getting when sending the request
  • any errors or other messages logged to CloudWatch that might help with the issue

@dougtoppin
Copy link
Contributor

@tmihalik We discussed automatically cropping the overlay image down to the base image dimensions when it was larger and decided that would be a behavior change. Instead, we changed the error response to be more specific and indicate that it was a bad request and that the failure was due to the overlay image dimensions. The request in this case will still fail but it will note the actual cause.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants