jasonraimondi / url-to-png

Selfhosted. URL to PNG utility featuring parallel rendering using Playwright for screenshots and with storage caching via Local, S3, or CouchDB
https://jasonraimondi.github.io/url-to-png/
MIT License
136 stars 26 forks source link

Bug: Incorrect resize when isFullPage=true and page height exceeds default #43

Closed AnnatarHe closed 2 months ago

AnnatarHe commented 2 months ago

Hi @jasonraimondi , Thanks for your hard work, I think I found a bug in latest version.

when the url is like this url-to-png.com/?url=xxx&isFullPage=true, the resize method would resize the output image incorrectly.

i think is because the line below, when height or width not provided, it will use the default 1000px, but is wrong if the page's height is bigger than 1000.

https://github.com/jasonraimondi/url-to-png/blob/main/src/lib/image_render.ts#L69

image
jasonraimondi commented 2 months ago

@AnnatarHe thank you for reporting this! I think I may have introduced this bug a few months ago when I ported the library from nestjs to honojs. I'll take a look at this one this afternoon after work and try and get a fix in quickly 👍

jasonraimondi commented 2 months ago

Looking more like the weekend before I'll have time to get a fix in here. If you're able to make a PR in the meantime I'd happily verify and merge it

jasonraimondi commented 2 months ago

resolved in v2.0.1