mikeboers / Flask-Images

On-demand resizing of images for Flask applications.
https://mikeboers.github.io/Flask-Images/
BSD 3-Clause "New" or "Revised" License
81 stars 43 forks source link

Allow files based on name #27

Closed iurisilvio closed 9 years ago

iurisilvio commented 9 years ago

I want to add some folders to IMAGES_PATH, but don't want all files exposed.

I'm thinking about something like:

IMAGES_PATH = [("/my/static", "*allowed*"), "/static"]
# or
IMAGES_PATH = ["/my/static/*allowed*", "/static"]

This way, I'll expose /my/static/allowed.png, but not /my/static/private.png. It is easy to implement it and I have a perfect use case for this feature.

Of course I can just extend and hack the find_img, but I'm looking for a better API.

Do you think it is useful for the project?

mikeboers commented 9 years ago

I think it might not be general enough use case to be directly supported, and would personally go for extending the class and replacing find_img.

I'm happy to hear opposing arguments though. shrugs

iurisilvio commented 9 years ago

I agree with you. I'll subclass my Images and override the find_img.