tjko / jpegoptim

jpegoptim - utility to optimize/compress JPEG files
http://www.iki.fi/tjko/projects.html
GNU General Public License v3.0
1.59k stars 117 forks source link

300dpi ->96dpi #178

Open Gerogelee opened 1 month ago

Gerogelee commented 1 month ago

During the process of converting JPG, all the original 300dpi resolution files were converted to 96dpi. How can I keep the 300dpi unchanged?

tjko commented 1 month ago

I don't think DPI information is part of the JPEG image. So it likely comes from some marker.

jpegoptim normally displays markers found in the image when its run, so if you run it again (for the optimized JPG image), you should see which markers got removed (don't appear anymore). That should point to which marker contains this information. Then you could use one of the --keep-xxxx options to tell jpegoptim not to remove the marker that contains DPI information..

For example, if its the Exif marker, then specifying option --keep-exif should work.