Google Photos API returns corrupt image when accessed with BASE_URL=d - google-photos-api

Our app implements the Google Photos API to allow our user to select the images from their Google Photos album and then edit them.
However, in some cases, the image retrieved from Google Photos API (with URL as BASE_URL=d) is corrupted, i.e., part of the image content is grayed out.
We can't replicate the issue on our phone, so it is difficult to tell whether the image data is already corrupted in the Google Photos album, or the data becomes corrupted during the internet transmission.
We've also implement the jpg data check (SOI = 0xffd8 and EOI = 0xffd9) for the download image data. For a jpg source that is originally corrupt (i.e., SOI = 0xffd8 but EOI != 0xffd9) and then upload to Google Photos, the corrupt criterion can be correctly triggered for the download data via Google Photos API. But for the jpg images that the contents are partially grayed out as mentioned in this issue, the criterion is never triggered.
Before using Google Photos API, we've used Picasa API for about 2 years. And the corrupt image issue never happens. Does anyone have the same issue with Google Photos API?

I'm having a similar issue through the Google Photos web site and contacted support about it. They said this is a known issue that started Mar 20th and that engineers are working on it.
More detail about what I ran into: I uploaded a photo via Backup & Sync (their desktop sync tool), which puts them in Google Drive, and have it set to replicate all pictures over to Google Photos. The photo looks fine in Drive, but the version in Google Photos is corrupted with a large block of the photo being a solid color.

Related

How to automate the search for an image with specific tags, then post it or them automatically and daily on tweeter with its API

So I want to make a bot that is similar to the twitter accounts like "2 images of... per day" without having to use images that I would have downloaded but using images on sites like DeviantArt and adding the source of the image in the tweet.
Thank you.

Telegram bot, is it possible to be sure that the image was not picked from the gallery

Is it possible to detect some information about an image sent to a Telegram bot?
the source of the image is the camera or the gallery.
the time image was created. (not message sending time).
When receiving a photo, the Telegram Bot API sends back only width, height, file size and a photo id to download the photo according to its documentation. Therefore:
The source of the photo can not be determined by the API itself unless this information can be found somewhere in the metadata of the photo itself. However, I believe that this would probably only show you the type of device the user was using, not the app the photo was taken with.
It is more likely, that you can find metadata about when the image was created in the image itself. In order to get to that data, you would have to download the photo and then use another tool to extract the metadata from the photo.
I have worked a lot with Telegram Bots and can confirm that Telegram does not transmit a lot of information about the user, the device the user is using, where files are coming from etc. in the API itself, which is actually in favour of its users.

Play mp3/audio on Google Drive preview at specific time

I have an audio file (e.g. mp3) located on Google Drive and accessible at a direct url that looks like https://drive.google.com/file/d/audio_file_id/view where there is a small sliding bar timeline scrubber and play/pause button that let the user hear the audio (and supposedly control the location in the file, but this feature is not working for me on Chrome on mac…; advice on this appreciated).
I would like to start the playback at a specific time. How can this be one? Is there a way to do it like one can do with video files hosted on Google Drive by adding a parameter like t=15s to the video url, like in YouTube?
Drive API doesn't have the seekTo method in Youtube API but you can add the t=123s at the end of the video url and it will work just like it.
sample:
https://drive.google.com/file/d/0Bz6447wI7cGV12546VBmQ2M/view?t=651s

get instagram saved posts

Instagram has a newish feature in their app (not on web) that let you save posts.
This is a good feature because, unlike liking a photo, no one else will know you saved the photo.
The question is: are these posts saved locally on your machine (or at least a reference to these posts is saved locally on your phone)? and if they are, is there a way to access this data?
In case your saved posts are not saved locally, but on the cloud, is there an api command to retrieve info about these posts?
Thanks
These "bookmarked" posts are saved to your account (in the cloud), and not on your local device.
Unfortunately it doesn't seems like they have an endpoint for that..yet
See Instagram API Changelog

Retrieving files from blog media entries

The tool I'm building needs pull data from IBM Connections Ideation Blogs. I therefore use the Connections API with basic authentication to read Blog Entries. This goes well until the description contains images. When I ask the API to provide media resources for the blog, it does not show any entries of the /BLOGS_UPLOADED_IMAGES location - the one containing images uploaded through the blog's richtext editor. The user I use in my API call is the same user who created blog entries and uploaded pictures.
However the API call DOES contain images I publish using the API and a POST request to the blog's media entry collection. This is where the next problem appears. Those Atom entries for images contain various links, one of them with a ref="enclosure", of which the API documentation (link) tells me to "Use the web address in the href attribute to obtain the binary content of the file". However, my calls to this adress are always answered with 404 response code.
Another url in the Atom entry (this time of the element) is described by the same documentation (see link above) as: "Provides access the document's media. The following operation is supported: GET: Use the web address to obtain the media." When I make a call to this url, as always with basic authentication credentials attached, the response contains the html of the login form of Connections, so API authentication does not seem to be supported on this url. This is only the case for non-public communities, which require authentication, of course, if the picture is publicly availabe all works just fine.
Am I missing something out? Is there another way to retrieve the actual image from a blog's media entry through the API? Are manually uploaded pictures never contained in the media entries result or is this a bug?
It now magically works using the link with ref="enclosure" from the atom entry. I might have gotten something wrong with authentication I guess (although I'm not actually realizing what I'm doing different now than I did before).
Problem remaining: Pictures uploaded through the rich-text editor in the folder /BLOGS_UPLOADED_IMAGES do not appear in the media feed of the blog.

Resources