Skip to content

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

Open
@chandra10207

Description

@chandra10207

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions