-
Notifications
You must be signed in to change notification settings - Fork 274
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
How to skip image processing for ProcessedImageField if no processing is needed #484
Comments
Probably we need to check somehow if the original image is returned from the processor(s) and than do something clever. Instead of monkeypatching on your side do you think that you can make PR with changes directly in ImageKit? |
I've solved the problem with a few tricks and may be this approach after some cleanup can be used.
So basically I just raise exception and pass any processing after that. But it works well only if we have one processor in pipeline. |
Main problem at the moment is in
Implementation seems quite easy to me so if you are interested I can prepare it. |
So I have a field like that:
and
OptionalResizeToFit
as follows:So the goal is to upload files less than 3000x3000 without any processing but resize too big ones.
I think it's quite a common case.
But the problem is that processing happens anyway.
ProcessedImageFieldFile
callsImageSpec.generate()
inside.It then calls
pilkit.utils.process_image
which applies all processors (actually doing nothing in my case) and saves image via PIL save and thus modify it.So I'm not sure how to do it without a lot of monkeypatching.
The text was updated successfully, but these errors were encountered: