I build an html doc by encoding images with base64.
Then, I upload the html on google docs, but images are 'quite never' displayed.
The encoding is right: for example, I use this to do the image encoding and then I use it in the img
tag for the src
attribute, changing properly the data type
<img src='data:image/gif;base64,<IMG_ENCODING>' />
or
<img src='data:image/jpeg;base64,<IMG_ENCODING>' />
or
<img src='data:image/png;base64,<IMG_ENCODING>' />
EDIT
I think the problem is tied to compression. I tried to use
NSData *imageData = [NSData dataWithData:UIImageJPEGRepresentation(image, 0.0f)];
And some of the images (that before aren't displayed) are displayed. But other images aren't. I don't know if there is a limit to the length on the base64 string on gdocs.
Is there a way to compress the base64 string before sending it to the server? or?
Any hint is greatly welcomed.