Set print metadata without changing the picture
Changing DPI updates the resolution metadata in JPEG or PNG. The pixel dimensions stay the same. A 1200-pixel-wide image at 300 DPI describes a nominal print width of 4 inches; it is not a higher-detail image.