Skip to content

Make it possible to not add background #11

@Vayel

Description

@Vayel

Hi!

I want to specify a maximum size for my images (let's say 1000px width and 1000px height). Then I did this:

image = OptimizedImageField(
    optimized_image_output_size=(1000, 1000),
    optimized_image_resize_method='thumbnail'
)

When I upload a rectangle image (like 4000px2000px), the field adds a white border around it to get a 10001000px image whereas I want 1000px to be the maximum, not the exact size.

The problem is here: https://github.com/agusmakmun/django-image-optimizer/blob/master/image_optimizer/utils.py#L68

Why don't you use the output of resizeimage directly, which has the right size?

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions