Django Rest Framework - How to store a GIF image

68 views Asked by At

I am working on a Django project using Django Rest Framework, and I am facing an issue related to storing and processing GIF images in one of my models.

class GiftCardPlan(model.Model):
# ... other fields ...
image = ProcessedImageField(null=True, blank=True, upload_to=giftcardplan_image_path,
                            processors=[SmartResize(480, 290, upscale=False)],
                            options={'quality': 100})

serializer

class GiftCardPlanSerializer(serializers.ModelSerializer):
    image = Base64ImageField(read_only=True)

I want to handle GIF images properly within the GiftCardPlan model. I've tried different approaches, but none seem to work as expected. My current implementation loses GIF animation during processing.

0

There are 0 answers