Google People API - How to get a user profile photo of a certain size, if it is not .jpg but .png - google-oauth

Good day.
Tell me, please, is it possible to reduce the profile photo of the user, if it is .png, and not .jpg
The fact is that the site has authorization through social networks, during authorization, we get a photo of the user, which we then use in the output of the avatar of his comments.
It happens that people upload huge photos for their google avatars and the link to them is also inserted into the img tag as a source, for photos like .jpg there is an opportunity to request its reduced size, but not for .png.
Example google user avatar link in .png format:
https://lh3.googleusercontent.com/a-/AAuE7amADg1dgDNpDnOAKONPyUkZVJJh56kwRXGE812tWPEOp
Example google user avatar link in resized .jpg format:
https://lh6.googleusercontent.com/-AJHQJsYSgJQQ/AAAAABAAdAAAI/AAAAaAAAAAAA/ACHi3rzc3h8GccE4aQl70zIZ3haKt12O5-BXW753kw/photo.jpg?sz=50

The syntax for resizing the user profile photo retrieved with the people API is
https://lh4.googleusercontent.com/ID_OF_THE_PHOTO=s[REPLACE_BY_A_PIXEL_VALUE], e.g.
https://lh3.googleusercontent.com/a-/AAuE7amADg1dgDNpDnOAKONPyUkZVJJh56kwRXGE812tWPEOp=s200
This works for any image format, see here for more information.

Related

How to get other people or page video thumbnail from facebook?

is there a way you can get video thumbnail from another people video or post?
I tried searching in google and stackoverflow and all i found is getting your own video thumbnail which is working fine by using https://graph.facebook.com/v11.0/443055553744880/thumbnails?access_token=my_access_token but it is not working if i change the video_id to other people video_id (443055553744880 is the video_id). I want to get any public video thumbnail regardless of who post it, not just my own video. Is there anyway to do that?
Thanks in advance
No, that is not really possible.
For access to videos on pages you do not have admin access to, you would need the Page Public Content Access feature - only the purpose of that is to “Provide competitive benchmark analysis”, so it is probably unlikely you would get it approved for other purposes such as to show videos on your site.
And for access to any content on user profiles, you would need the individual user’s permission first.
If you just want to show the videos somewhere, then you can use the Embedded Video & Live Video Player for that, or the oEmbed endpoints.

Firebase's Google Authentication User Object returns profile path with 404 response

Am using Firebase Google Authentication in my App. If the user does not have a profile image, Google used to return a dynamic picture, made up from the user's first or last initial, or digraph where applicable, all depending on each person's name structure.
Eg : If the user name is Jack and he does not have profile picture the
URL will return this image.
But Past few weeks the Url Returned by the method
FirebaseAuth.getInstance().getCurrentUser().getPhotoUrl(); is a 404
page.
Because of this am getting Exceptions in Glide app. I need an image as above as my App is a conversation app, Which will help users to identify easily if they dont have a profile image. Please let me know if google changed the way accessing the image or it stopped permanently. Also provide me any alternatives to get this above image.

phoenix: show image from aws s3

I study the phoenix, create an application that loads the image on aws s3, and then displays it. I was able to upload the image to the cloud, but now it is not clear how to display it to the user on the page (I do not want to make public link to these images in the cloud). I was looking for information on this issue, but did not find anything useful.
From the clouds I get the file as binary data. Do I need to create some of these data is a temporary file that will be displayed on the page? I can display the image as base64, but I think this is not the best way. I would appreciate advice.
Since you've already fetched the image to a binary, you can just send it directly to the client with the appropriate content type and the browser will render it as an image. For example, to fetch and send the png at https://upload.wikimedia.org/wikipedia/commons/7/70/Example.png:
def index(conn, _params) do
image = HTTPoison.get!("https://upload.wikimedia.org/wikipedia/commons/7/70/Example.png").body
conn
|> put_resp_header("content-type", "image/png")
|> send_resp(200, image)
end
If you open this in your browser, you'll see the image being rendered correctly because of the content-type header.

Incorrect image displayed when Gigya opens Google Plus share modal

I'm working with Gigya's Share Bar javascript api and am having an issue with google plus sharing. I have separate UserAction objects for facebook, twitter and google plus to display different text and linkbacks. I'm adding a media item (image) to the facebook and google plus actions to share that image along with the text. Facebook is sharing the correct image, however, google plus is displaying a different image. I have no idea where this image is coming from. Text and link are correct on both, but the image is frustratingly incorrect.
Has anyone encountered an issue like this? Is there something different that must be done for google plus shares?
Test your target URL with Google's structured data testing tool.
Read the snippet documentation to understand how the Google crawler determines what to use in the share preview.

Graph API - Photo uploaded by API is not visible

I`m geting the following problem.
Using graph api I can create an album (exactly photo album of my app). There is no problem also to upload photo to already created album (I have aid of this album as result of previous operation). After uploading photo I get also pid of the photo.
The problem starts now at the moment when I would like to get photos of the album. Graph API returns an empty array. Also I don't see any new album when I go to app page. However if I go to wall of my app page, I see this photo on "last added photos" list. I can enlarge uploaded photo, and I even see info that it's located in the proper album. There is another wird thing. If I choose this album, Facebook notice me that it`s an empty album.
I doesn't mean those operations are not done well, because if I request for a particular photo using pid (which I know from upload photo operation) I get a proper result - photo exist. Unfortunately it's really uncomfortable to store all pids of album in data base and perform separated request to each of it.
If the Facebook App is in "sandbox" mode, the images will only be visible to the admin/developers/tester users. Public users will not see the images.
Turning sandbox mode off fixed this issue for me.