diff --git a/apps/gallery/serializers.py b/apps/gallery/serializers.py index 41e75cd7..fb5bfa26 100644 --- a/apps/gallery/serializers.py +++ b/apps/gallery/serializers.py @@ -98,7 +98,7 @@ class CropImageSerializer(ImageSerializer): x1, y1 = int(crop.split(' ')[0][:-2]), int(crop.split(' ')[1][:-2]) x2, y2 = x1 + width, y1 + height crop_params = { - 'geometry': f'{self._image.image.width}x{self._image.image.width}', + 'geometry': f'{round(x2 - x1)}x{round(y2 - y1)}', 'quality': 100, 'cropbox': f'{x1},{y1},{x2},{y2}' }