I currently save image strings (this is how they are provided through API) as a binary in my database but I need to (after creation), change this to a file structure, probably using Paperclip/Carrierwave and S3.
What is the best way to convert binary to image file e.g. jpg?
This did the trick:
sio = StringIO.new(Base64.decode64(string))
[ source: base64 photo and paperclip -Rails ]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With