You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the thumbnail template tag in a site which also uses the s3boto file-storage backend to store all media files in an S3-backed CDN, files containing any characters which are urlencoded result in broken thumbnail links. This seems to be because the thumbnail tag code saves the auto-generated thumbnail to S3 using a urlencoded path (https://github.com/stephenmcd/mezzanine/blob/master/mezzanine/core/templatetags/mezzanine_tags.py#L400), but the s3boto backend does not expect this and does not un-encode it. Therefore, files are saved to S3 with with names such as "image-%23fff.png" instead of "image-#fff.png" and links to these files from the pages themselves are broken.
The text was updated successfully, but these errors were encountered:
Looking over the code I think a simple change to the line you linked to should do the job. thumb_url is quoted because this is in a template tag, whose output is destined for an img element's href attribute – saving to S3 was probably added later, and the existing quoted path was used unchanged.
When using the thumbnail template tag in a site which also uses the s3boto file-storage backend to store all media files in an S3-backed CDN, files containing any characters which are urlencoded result in broken thumbnail links. This seems to be because the thumbnail tag code saves the auto-generated thumbnail to S3 using a urlencoded path (https://github.com/stephenmcd/mezzanine/blob/master/mezzanine/core/templatetags/mezzanine_tags.py#L400), but the s3boto backend does not expect this and does not un-encode it. Therefore, files are saved to S3 with with names such as "image-%23fff.png" instead of "image-#fff.png" and links to these files from the pages themselves are broken.
The text was updated successfully, but these errors were encountered: