GPhoto streamlines the photo uploading process and helps you keep your photo library organized. Say goodbye to manual photo uploads and hello to efficient photo management with GPhoto.
Please make sure you have the following requirements installed below:
Download the latest release from the releases page or clone this repository.
Due to hardware limitations of the Apple Silicon chipsets on macOS, the ext-inotify extension is not supported. Consequently, we offer two different build variants to handle this
situation:
Non-inotify Variant: This is a standard variant that doesn’t rely on the inotify extension. It involves the following step:
Inotify Variant: This variant provides an automated process, leveraging the ‘inotify’ feature available on Linux. It works as follows:
Please note that the Inotify variant offers a more efficient and seamless experience but it is not compatible with macOS environment that use Apple Silicon chipsets. On the other
hand, this variant is highly recommended for Linux users who have the inotify extension installed and enabled.
Before using this application, you need to create a Google Cloud Platform project and enable the Google Photos Library API and create a OAuth 2.0 Client ID.
The authentication file should look like this :
{
"web": {
"client_id": "xxxxxxx.apps.googleusercontent.com",
"project_id": "xxxxxxx",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_secret": "xxxxxxx",
"redirect_uris": [
"http://localhost:3000"
]
}
}
php gphoto auth:create --auth=./path/to/auth.json --listen=http://localhost:3000
If your listener is behind a proxy, you can specify a different redirect URI.
php gphoto auth:create --auth=./path/to/auth.json --listen=localhost:3000 --redirect=https://yourdomain.com
[!NOTE] Make sure this listener/redirect URI is also registered in your Google OAuth configuration
You can also create a custom profile by providing a profile name as the first argument:
php gphoto auth:create personal --auth=./path/to/auth.json --listen=localhost:3000
The expired token can be renewed with the following command
php gphoto auth:reload
Or for a specific profile:
php gphoto auth:reload personal
By default, it uses the “default” profile, but you can use a different profile if needed by adding --auth=personal to the arguments in all the following commands
php gphoto upload:photo ./path/to/photo.png
or you can use --album to upload to a specific album.
php gphoto upload:photo ./path/to/MyPicture.png --album="My Album"
To upload multiple files, you need to create a directory that contains all photos with the following structure:
. Pictures
├── MyPicture 1.jpg
├── MyPicture 2.jpg
├── MyPicture 3.jpg
└── MyPicture 4.jpg
php gphoto upload:photo ./path/to/Pictures
or you can use --album to upload to a specific album.
php gphoto upload:photo ./path/to/Pictures --album="My Album"
php gphoto list:albums
To upload a single album, you need to create a directory that contains all photos with the following structure:
. MyAlbum
├── MyPicture 1.jpg
├── MyPicture 2.jpg
├── MyPicture 3.jpg
├── MyPicture 4.jpg
└── MyPicture 5.jpg
php gphoto upload:album ./path/to/MyAlbum
This will upload all files in the MyAlbum directory to Google Photos and create an album with the MyAlbum name.
To upload multiple albums, you need to create a directory that contains all albums with the following structure:
. MyAlbumCollection
├── MyAlbum 1
│ ├── MyPicture 1.jpg
│ ├── MyPicture 2.jpg
│ ├── MyPicture 3.jpg
│ └── MyPicture 4.jpg
│
└── MyAlbum 2
├── MyPicture 1.jpg
├── MyPicture 2.jpg
├── MyPicture 3.jpg
└── MyPicture 4.jpg
php gphoto upload:album ./path/to/MyAlbumCollection --multiple
This will upload all files in the MyAlbumCollection directory to Google Photos and create an album with MyAlbum 1
and MyAlbum 2 names.
The MIT License (MIT). Please see License File for more information.