How to preserve the DPI of cropped images? #971
-
I need to accept images that are 150+ DPI for print, and let the user crop them. However it appears cropper is outputting a 72 dpi image after cropping? How can I ensure that the DPI of the image is preserved? |
Beta Was this translation helpful? Give feedback.
Answered by
fengyuanchen
Aug 13, 2022
Replies: 1 comment
-
If you want to print an image with 240x2400px (150DPI), you can crop an image with 500x500px (72 DPI): const ratio = 150 / 72;
const targetSize = 240;
const sourceSize = targetSize * ratio; // 500 |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
IB21-A
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you want to print an image with 240x2400px (150DPI), you can crop an image with 500x500px (72 DPI):