deivitaka / gphotos Goto Github PK
View Code? Open in Web Editor NEWA wrapper around the Google Photos API.
License: MIT License
A wrapper around the Google Photos API.
License: MIT License
I love this library ๐
I use it to list users pictures, in a purely read-only fashion, my code looks like this :
GPhotos.initialize(with: Config())
GPhotos.authorize(with: [.openId, .readOnly], completion: { _, _ in
GPhotosApi.mediaItems.list(completion: { _ in })
})
This asks the user for 2 authorizations (.readOnly
and .readDevData
) :
But I don't need the .readDevData
authorization (at least I think so)
In GPhotosResource.swift
:
internal struct scopes {
static let read: ScopeSet = ([.readOnly, .readDevData], [.readAndAppend])
Both are required, so changing the line 16 to this would solve my issue :
static let read: ScopeSet = ([.readOnly], [.readDevData, .readAndAppend])
However I'm not sure this is the way to go, is it the wanted behavior to always ask for .readDevData
alongside .readOnly
?
If I don't set a filenames array in the upload function, the function crashes at the following line:
self.upload(image: images.popLast()!, filename: filenames.popLast()!) { (token) in
As a workaround I create an array with empty filenames:
let filenames = [String?](repeating: nil, count: images.count)
I started to use this library and tried to retrieve a list of all my shared albums. But I only get 18 albums, I have much more. Could it be, that there is some problem with pagination with shared albums?
Please push the new version 0.6.0 to the cocoapods repo. So it can be installed via pod update
I'm running into some issues where I upload a portrait photo from iOS that gets rendered as a landscape photo in Google Photos. From my testing it seems to most likely be the result of loading it as a UIImage
and calling pngData()
. Would it be possible to have MediaItems.Item
support Data
instead, to allow lossless image uploading to Google Photos, uploading videos, etc?
GPhotos is great!!
But Album.share is not working for my environment.
(XCode 11.3.1, Swift5)
Error Message Below.
GPhotos E: Optional("Invalid JSON payload received. Unexpected token.\nsharedAlbumOptions%5\n^")
Please tell me how to fix this.
I see that it looks like API errors are getting logged out properly via a handle()
method, but would it make sense to expose these in the method completion as well? Right now, for instance, if a MediaItem upload fails I just receive res
as []
, or if adding photos to an album fails I just receive false
. In my case this is because I'm uploading a lot of photos and getting 429 Quota exceeded
API responses, and I'd like to back off and try again. Whereas with other errors, I'd probably want to just give up and show an error message.
I assume it's a bit more complicated by the fact that the failure could be an HTTP status error or it could be something lower down the stack, so I assume we'd either need two extra arguments to the completion (maybe Status?
and Error?
) or a single Error?
that could be switched to either a Status or other type of Error. But I'm not as familiar with Swift error handling best practices so feel free to disregard these suggestions.
Hello Team,
I'm using GPhotos to upload the images but i'm facing some issue. I have try to uploading the image second time, got correct response from api but the image not shown in the Google Photos. Could you please check and update me, how to solve this issue.
Thank you.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.