django-imagekit icon indicating copy to clipboard operation
django-imagekit copied to clipboard

Add options as ImageSpec init paramaters

Open apavillet opened this issue 10 years ago • 2 comments

Would it be possible to add the options as an init paramters in ImageSpec class? Do you see problem with doing something like this:

def __init__(self, source,options=None):
        self.source = source
        if self.options :
               self.options = options
        super(ImageSpec, self).__init__()

apavillet avatar Feb 17 '15 11:02 apavillet

I can't think of any issues off the top of my head, but we'd have to add tests to make sure that serialization wasn't messed up at all. I guess if we did that, we'd also want to add processors, format, etc.

matthewwithanm avatar Feb 17 '15 18:02 matthewwithanm

We added a class on top with this and it's working fine, but we're not using serialization or such so it might not be functionnal for everything :)

The purpose was to set qualitfy according to file size if you're wondering :)

Thanks

apavillet avatar Feb 17 '15 21:02 apavillet