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

Unable to Soft Crop Uploaded Image and upload to respective folder #507

Open
chandra10207 opened this issue Sep 5, 2020 · 0 comments
Open

Comments

@chandra10207
Copy link

I have the following model on my App

def image_path(self, filename):
    return 'app_name/images/{}/{}'.format(slugify(self.name), filename)

class Color(models.Model):
    name = CICharField(max_length=22, unique=True)
    image = models.ImageField("Image", upload_to=image_path, blank=True)

Once the image is uploaded I want to create 3 images size: small (100 by 100), medium (300 by 300) and large (800 by 800) with the soft image crop. Then I want to manage the URL Structure for my upload.

For Eg.

Original Image URL from "Image" field = 'app_name/images/image_1.jpg'
Then Cropped Image from imagekit produce following images.

small = 'app_name/images/small/image_1.jpg'
medium = 'app_name/images/medium/image_1.jpg'
large = 'app_name/images/large/image_1.jpg'

I didn't found any options for this on the documentation page. Can anyone tell me, Is this possible with Imagekit.

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