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

Add PrivateImageField #4

Open
AndyLPK247 opened this issue Jul 10, 2017 · 3 comments
Open

Add PrivateImageField #4

AndyLPK247 opened this issue Jul 10, 2017 · 3 comments

Comments

@AndyLPK247
Copy link

This is a request-for-enhancement: It would be really nice to have a PrivateImageField that borrows functionality from the standard ImageField class.

@vdboor
Copy link
Member

vdboor commented Jul 17, 2017

Agreed, that would be a nice addition! A patch for this feature is more then welcome!

@kamranhossain
Copy link

This is really amazing package for me. Please let me know if PrivateImageField will add? Thanks @vdboor
and @AndyLPK247 for your effort 👍

@asfaltboy
Copy link
Contributor

btw, I defined this locally, is this what we're looking for?

class PrivateImageField(PrivateFileField, models.ImageField):
    def __init__(self, *args, **kwargs):
        kwargs['max_file_size'] = kwargs.get(
            'max_file_size', settings.DEFAULT_MAX_FILE_SIZE
        )
        super().__init__(*args, **kwargs)

It works pretty well, but there are edge cases with regards to image transfer being required to get/set width/height attributes.

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

No branches or pull requests

4 participants