Skip to content

Since 6.0, setting float resolution with dpi argument converts to an integer #4129

@Bolayniuss

Description

@Bolayniuss

Since Pillow==6.0, when doing this:

pillow_image.save(
    file_path,
    dpi=(812.8, 812.8)
)

the resolution of the of the saved file is (813, 813), even if the dpi value is a PIL.TiffImagePlugin.IFDRational object. (I use Photoshop CS6 to check the resolution)

before 6.0 it was (812.8, 812.8).

I've found that using the resolution argument solve this issue but then the img.info is a bit weird as it gives two different values for the resolution and dpi

{'dpi': (813, 813), 'resolution': (812.8000797477443, 812.8000797477443)}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions