Enjoy an ad free experience by logging in. Not a member yet? Register.
|
|
Results 1 to 8 of 8
Thread: BASE64 to Blob
-
04-13-2016, 03:10 PM #1Regular Coder
- Join Date
- Jun 2010
- Posts
- 173
- Thanks
- 0
- Thanked 4 Times in 4 Posts
BASE64 to Blob
I'm working on an app. I'm allowing users to upload photos which takes the photo, re-sizes the quality and size in canvas, then saves it as a base64 to store into the DB. When I pull it back out, should I convert it to a blob or should i just use the base64 string as an image src?Check out my blog and portfolio at http://calebprenger.com
-
04-14-2016, 11:35 AM #2Regular Coder
- Join Date
- Aug 2009
- Location
- Jakarta, Indonesia.
- Posts
- 438
- Thanks
- 10
- Thanked 62 Times in 61 Posts
base64 is a text, not binary AFAIK.
-
04-14-2016, 05:08 PM #3Regular Coder
- Join Date
- Jun 2010
- Posts
- 173
- Thanks
- 0
- Thanked 4 Times in 4 Posts
Check out my blog and portfolio at http://calebprenger.com
-
04-14-2016, 06:39 PM #4Regular Coder
- Join Date
- Aug 2009
- Location
- Jakarta, Indonesia.
- Posts
- 438
- Thanks
- 10
- Thanked 62 Times in 61 Posts
Yeah, right.
but why? img src can accept image filename or... base64. Have a loook in here:
https://developer.mozilla.org/en-US/...e_via_data_URL
-
04-14-2016, 06:57 PM #5Regular Coder
- Join Date
- Jun 2010
- Posts
- 173
- Thanks
- 0
- Thanked 4 Times in 4 Posts
My question was, is it more resource intensive because of the length of base64?
Check out my blog and portfolio at http://calebprenger.com
-
04-14-2016, 07:35 PM #6Regular Coder
- Join Date
- Feb 2016
- Location
- Keene, NH
- Posts
- 311
- Thanks
- 0
- Thanked 42 Times in 40 Posts
Given you are posting this under JS programming, I'd suggest sticking with base64 just because JavaScript inhales upon the proverbial equine of short stature when it comes to dealing with binary encoded data.
But the question really is WHAT sort of database are you storing it in, HOW are you using it, and why are you putting it into a DB instead of a real file in the first place?
Still, there is toBlob -- if you want to use it as blob I'd be doing that before storing it just to save that extra 2/8ths+ overhead... but really things like canvas to image illustrates quite well how pathetic JS implementations still are for things like this.From time to time the accessibility of websites must be refreshed with the blood of designers and owners; it is its natural manure.
http://www.cutcodedown.com
-
04-14-2016, 08:20 PM #7Regular Coder
- Join Date
- Jun 2010
- Posts
- 173
- Thanks
- 0
- Thanked 4 Times in 4 Posts
Check out my blog and portfolio at http://calebprenger.com
-
04-16-2016, 08:27 PM #8Regular Coder
- Join Date
- Feb 2016
- Location
- Keene, NH
- Posts
- 311
- Thanks
- 0
- Thanked 42 Times in 40 Posts
From time to time the accessibility of websites must be refreshed with the blood of designers and owners; it is its natural manure.
http://www.cutcodedown.com



Reply With Quote
