sunny_jay_jay's avatar

Image uploading with Intervention - how to maintain DPI

I am uploading images using Intervention Image. I am not resizing them at all but I am encoding them (encode('jpg', 100) and streaming them to AWS S3 (stream('jpg', 100).

My source images have a DPI of 350. The uploaded images have a resolution of 96. Why is this and how can I maintain the resolution of the uploaded image?

0 likes
7 replies
Mithrandir's avatar

if they are already jpg, why encode them to jpg? I am no image expert, but jpg is not a lossless format, so could it be that you lose some details in the encoding?

Also, can you separate the process to determine if the reduction happens in the encode() step or the stream() step? Or both?

sunny_jay_jay's avatar

Even if I just save the file to local disk, no encoding, just $img->save('/path', 100) my image DPI reduces to 96, despite the original being much higher DPI than that.

Snapey's avatar

but jpg are fixed pixel dimensions - they don't have DPI

sagar001's avatar

I am Saving the real image as like this


$image->move($destinationPath, $fileName);

And it is saving the real image...

Please or to participate in this conversation.