Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make it possible to not add background #11

Open
Vayel opened this issue Oct 17, 2022 · 0 comments
Open

Make it possible to not add background #11

Vayel opened this issue Oct 17, 2022 · 0 comments

Comments

@Vayel
Copy link
Contributor

Vayel commented Oct 17, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant