NicholasDawson / ArchiverForGooglePhotos

A tool to maintain an archive/mirror of your Google Photos library for backup purposes.
GNU General Public License v3.0
194 stars 30 forks source link

RAW Images stored in Google Photos cannot be downloaded #9

Closed Snuggle closed 3 years ago

Snuggle commented 3 years ago

It seems that raw photos from dedicated cameras that are stored in Google Photos won't be able to be downloaded as Python's pillow library doesn't seem to support them. As this is an upstream issue it might be difficult to find a fix, but it seems that most RAW formats aren't supported by Pillow and instead rawpy is usually used.

I have thousands of .arw images stored in my Google Photos which is a raw image format used by almost all Sony cameras.

Upstream Issue: https://github.com/python-pillow/Pillow/issues/3124

✔ Finished Downloading Shared Albums.

Reading Entire Library From Server...

Downloading Library:  16%|████████████████████████████████████████████▉  | 3539/22777 [00:04<00:09, 1956.83 media items/s]
ERROR: media item could not be downloaded because: unknown file extension: .arw
ERROR: media item could not be downloaded because: unknown file extension: .arw
ERROR: media item could not be downloaded because: unknown file extension: .arw
ERROR: media item could not be downloaded because: unknown file extension: .arw
ERROR: media item could not be downloaded because: unknown file extension: .arw
NicholasDawson commented 3 years ago

The reason I use Pillow is to embed the description of a media item in Google Photos into the EXIF data of the downloaded image manually since this information is not stored in the image file, but in a database on their servers.

I don't think that RAW files would need this type of functionality and from my simple research, it seems EXIF data is not supported on RAW files.

I think I will add an exception that will just skip the Description field if the file is not supported by Pillow.

What do you think?

Snuggle commented 3 years ago

@NicholasDawson, hmm. I think .ARW files do still contain EXIF data. After popping one of my .ARWs from my Sony camera into this website http://exif.regex.info/exif.cgi I end up seeing the EXIF data below for example.

I would think that information such as lens type, ISO, exposure time, f/stop would be quite important to someone who took photos on a dedicated camera, so I'd keep all of this EXIF data if possible, though I can't see the use case for a 'Description' field.

Is skipping description but keeping all the other EXIF data an option?

image

NicholasDawson commented 3 years ago

Yes by default the normal data included in the image is kept, the description field is appended to the existing exif data on the image.

So skipping the description on unsupported files would work, and I think it is the best solution here.