Skip to content

Simply opening a photo and saving it doubles the file size with Q=100 #364

@mcosti

Description

@mcosti

As the title says, simply doing this:

file = open(sys.argv[1], mode="rb")
image = pyvips.Image.new_from_buffer(file.read(), options="", access="sequential", autorotate=True)
image.write_to_file("applied_layer.jpg", Q=100)

Results in a photo being double the size. 1.8MB results in 3.6MB. I've tested this with 3 photos taken with different DSLR cameras and they all reproduce.

My code actually adds a watermark to the photo, so I don't want to have so much extra storage, but I don't want to lose any photo quality.

Could anyone help me with this? I uploaded a sample photo but I am not sure if github will save it properly to reproduce the issue
Thanks

6C7B9450

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions