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

flask-images endpoint with Flask-Restful #46

Closed erwinyusrizal closed 6 years ago

erwinyusrizal commented 6 years ago

Hi @mikeboers ,

Any idea to make this extension work with flask-restful?

Cheers,

erwinyusrizal commented 6 years ago

OMG...My mistake I forgot it relies on its cache id when build the url :) that's why it keeps returning 404

erwinyusrizal commented 6 years ago

I'm sorry I have to reopen this, I was spoke too soon before. It works for static but not the flask-restful endpoint, it returns 404, any idea how to fix this?

Thank you

wzuo commented 6 years ago

You can use function to return image source, then use this as a field value for flask restful. I think this is proper way to serve images via REST, not embedding in JSON

erwinyusrizal commented 6 years ago

Yes I got it working now, I forgot I override all the response to json

mikeboers commented 6 years ago

Glad I could help! Lol.