marteinn / wagtail-alt-generator

Insert image description and tags with the help of computer vision
MIT License
83 stars 13 forks source link

Improve image url handling with external storage #39

Closed zerolab closed 4 years ago

zerolab commented 4 years ago

we use django-storages with the s3boto3 storage backend.

S3 is configured with AWS_DEFAULT_ACL = "private", with only MEDIA_ROOT/images|documents being exposed to the public.

Alt generation fails because image.file.url points to S3_URL/original_images/filename.ext (thus under ACL restrictions) whereas S3_URL/images/filename.original.ext (the rendition folder) works well. Note this the latter is also the URL seen on the edit page under "File".

marteinn commented 4 years ago

Thanks for the PR @zerolab! LGTM. Merging.

marteinn commented 4 years ago

@zerolab FYI: I just shipped a new version https://github.com/marteinn/wagtail-alt-generator/releases/tag/v4.1.2 with this fix. Thanks again for this!