Remove EXIF data on image upload
This commit is contained in:
@@ -20,7 +20,7 @@ from images.decorators import (
|
|||||||
can_upload_image,
|
can_upload_image,
|
||||||
)
|
)
|
||||||
from images.models import Image, ImageVariant
|
from images.models import Image, ImageVariant
|
||||||
from images.utils import get_b2_resource
|
from images.utils import get_b2_resource, remove_exif_gps_data
|
||||||
|
|
||||||
JpegImagePlugin._getmp = lambda x: None
|
JpegImagePlugin._getmp = lambda x: None
|
||||||
|
|
||||||
@@ -94,8 +94,12 @@ def upload(request):
|
|||||||
is_primary_variant=True,
|
is_primary_variant=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
bucket.upload_fileobj(
|
image_data = remove_exif_gps_data(file.read())
|
||||||
file, variant.backblaze_filepath, ExtraArgs={"ContentType": content_type}
|
|
||||||
|
bucket.put_object(
|
||||||
|
Body=image_data,
|
||||||
|
Key=variant.backblaze_filepath,
|
||||||
|
ContentType=content_type,
|
||||||
)
|
)
|
||||||
|
|
||||||
image.create_variant_tasks(variant)
|
image.create_variant_tasks(variant)
|
||||||
|
Reference in New Issue
Block a user