I'm using the Google Admin SDK in NodeJS to get a list of users. I can't seem to use the thumbnail there in a public fashion, so I'm taking their use ID and calling users.photos.get (NodeJS SDK) and in return I get web-safe Base64 photo data and mime type.
I'm trying to figure out how the hell to get my image to actually display. I'm going to the img tag and setting SRC attribute via JQuery to this inline CSS made of the format:
'data:' + photo.mimeType + ';base64,' + photo.photoData
So this comes out like: data:image/gif;base64, longAssString.
The problem is the images are always broken. I can't figure out if I'm doing something wrong, or if somehow Google is giving me some bad data or I need to do some sort of extra REGEXing on the string because it's in some 'web-safe' format?
Maybe my images are broken, but they both display fine in the Google Admin Dashboard when administrating the users (they are test users). I've tried playing with the Google Closure Library for it's decode function, but it literally decodes it into strange characters.
Ultimately I just want to get the user's photo from the Google Admin Directory so I can import it into another system!