sorl-thumbnail icon indicating copy to clipboard operation
sorl-thumbnail copied to clipboard

Ability to select different storages from source and destination

Open submarcos opened this issue 6 years ago • 1 comments

Hi, I am user of sorl-thumbnail and it's very usefull.

In particular project and storage config case, we choose to store data in an s3 backend signed and private. I have no problem with default storage (media, s3, public), thumbnails are generated as well.

I have problem to generate thumbnail in another storage backend than Media, because there is no way to select Source storage.

Ex :

https://github.com/jazzband/sorl-thumbnail/blob/master/sorl/thumbnail/base.py#L74

It is ok if I set custom backend by overriding ThumbnailBackend -> get_thumbnail method

I need to replace ImageFile(file_) with ImageFile(file_, storage=get_storage()), where get_storage() is function returning my specific storage.

Do you think it is possible to integrate this functionality without rewrite all this function ? (adding argument etc)

It would be better if we could to choose source and destination backend as wanted.

I have no problem with my custom backend, but I need to rewrite and test all method whereas just this line should be overrided

Thank you for your advice

submarcos avatar Mar 24 '20 13:03 submarcos

I try to play with THUMBNAIL_STORAGE, but it's same problem

submarcos avatar Apr 14 '20 12:04 submarcos