New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return image base64 encoded #59

kleisauke opened this Issue Feb 12, 2017 · 0 comments


2 participants

kleisauke commented Feb 12, 2017

Return image base64 encoded [4522336]

Submitted by Nick @ on 2-10-2013 0:00:00
14 votes on UserVoice prior to migration

I like your service very much!
Could you please add a parameter for encoding?
Example: &encoding=base64 returns the base64_encode($image) string.
Thats very useful for embedding images directly. And the string is cached via Cloudflare. So it's fast and efficient.


by Andries Louw Wolthuizen on 8-12-2013 0:00:00

Wrote the code, please help by testing it.
Example usage:
This will return a string which can be used directly in the src= of a -tag:
Let me know if you run into any problems, thanks!


Comment by Nick @ on 6-10-2013 12:57:00

I am very excited about this feature and hope that it will be integrated soon :)

Comment by Andries Louw Wolthuizen (Webmaster, - Image cache & resize proxy) on 6-10-2013 15:33:00

Update: Also fixed some problems when the proxy runs into an error. If you use base64, and an error occures, it will return "data:text/plain;Error". If you want to know the full details of the error, you need to remove "&encoding=base64" to see the full message.
This is to prevent XSS-injection of error messages into your tag.

Comment by Nick @ on 6-10-2013 16:35:00

Thanks for this fast implementation!
I let you know if there are any issues.

Original UserVoice Submission

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment