Closed AnnatarHe closed 3 years ago
@AnnatarHe I just added a branch called device-scale-factor
that supports this field, but in my testing, I did not see any output difference of screenshots. Do you mind testing and seeing if this does what you are expecting?
http://localhost:3000/?url=https://jasonraimondi.com // defaults to 1
http://localhost:3000/?url=https://jasonraimondi.com&deviceScaleFactor=2
http://localhost:3000/?url=https://jasonraimondi.com&deviceScaleFactor=3
All of the above seemed to me to be relatively the same output screenshot.
I clone the repo and switch to branch device-scale-factor
and tried to download
http://localhost:3000/?url=https%3A%2F%2Fjasonraimondi.com&isMobile=true&isFullPage=true&viewPortWidth=375&width=375&deviceScaleFactor=1
by change width
and deviceScaleFactor
with width=375
, width=1125
and deviceScaleFactor=1
, deviceScaleFactor=3
and Airdrop to iPhone 12 try to scale image
In my eyes I think width=1125
and deviceScaleFactor=3
has the best quality
1125 with 1 dpi
1125 with 3 dpi
375 with 3 dpi
375 with 1 dpi
Oh awesome thank you for the great update! I'll go ahead and merge this into master and get a tag out for v1.2.0
merged #13
puppeteer support
deviceScaleFactor
for high resolution screenshot. can we support that parameter?I notice that maybe we can change this line: https://github.com/jasonraimondi/url-to-png/blob/master/src/services/image-render.service.ts#L62