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

embed error when using pipeline with resize + watermark on small image #395

Open
ianjosephwilson opened this issue Jun 24, 2022 · 1 comment

Comments

@ianjosephwilson
Copy link

I'm trying to migrate some old image resizing code I have that has a set of fixed sizes that are blindly cut from the originals. Some of the images are really old and probably should never be cut but the system isn't smart.

My pipeline operations looks like this:

[{"operation": "resize", "params": {"width": 950}}, {"operation": "watermark", "params": {"text": "www.123.example.com", "noreplicate": true}}]
curl 'http://localhost:8090/pipeline?file=images%2Foriginal%2F64%2F64316f9775cc421f8383033a301177c7&operations=%5B%7B%22operation%22%3A+%22resize%22%2C+%22params%22%3A+%7B%22width%22%3A+950%7D%7D%2C+%7B%22operation%22%3A+%22watermark%22%2C+%22params%22%3A+%7B%22text%22%3A+%22www.123.example.com%22%2C+%22noreplicate%22%3A+true%7D%7D%5D' -o ana.jpg

I get the following error:

{"message":"Error while processing the image: embed: bad dimensions","code":1}

It seems to be a problem with the size of the image and the size of the watermark but I don't see how I can scale the watermark text down with the image size. It seems that images less than 300/400 px seem to be a problem.

@ianjosephwilson
Copy link
Author

ianjosephwilson commented Jun 24, 2022

After further testing my 949(w)x759(h) image starts working at sizes 500, 600, 700 starting at 100 and above but my 120x141 image never works and always results in that error.

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

No branches or pull requests

1 participant