0

I am under the impression that JPEGs cannot store resolution/DPI/density information. How is it possible that iOS Image Preview is able to provide resolution per image attached?

The reason I ask is that I need to alter the resolution to a specific number so that when I send the image to a 3rd party API, they know how many pixels per inch to print. I only allow image uploads in JPEG/PNG format.

Any solutions in javascript would be greatly appreciated

Thanks! enter image description here

andre
  • 1,660
  • 3
  • 19
  • 31
  • a jpeg most certainly stores its resolution. dpi is arbitrary. – dandavis Sep 30 '17 at 03:37
  • @dandavis do you know how I can store resolution programmatically? preferably in javasript as I am using a combination of js/node/ sharp npm image processing – andre Oct 01 '17 at 00:18

1 Answers1

0

You have to change the values from pixels to inches and then set the dimensions. The resolution for full hd images is 1024 or 720 pixels per inch

Darsh K
  • 41
  • 1
  • 9
  • Yes but then the printed image will not be good quality potentially. If I have a big good quality image than can be 300DPI, by keeping it at 72 or 96 DPI (which is what images default to), I will be losing out on 4x the quality of the image. – andre Oct 01 '17 at 00:22
  • The one I have given is for standard quality images, for hd ones, you need to simply do the math and multiply – Darsh K Oct 02 '17 at 13:46
  • Instead of multiplying by 96, you can multiply it by 300 or any DPI you want – Darsh K Oct 03 '17 at 14:02