f2calv / CasCap.Apis.GooglePhotos

*unofficial* Google Photos REST API library for .NET projects.
MIT License
58 stars 10 forks source link

MimeType support #143

Closed ieei0214 closed 10 months ago

ieei0214 commented 10 months ago

Hello,

Thanks for the excellent .net library.

Try to upload the RW2 file which is supported by google photo but get System.NotSupportedException.

System.NotSupportedException: 'Cannot match file extension '.RW2' from 'd:/temp/GooglePhotos/P1000195.RW2' to a known image or video mime type.'

The AcceptedMimeTypesImage needs to include a more supported format.

    static readonly HashSet<string> AcceptedMimeTypesImage = new(StringComparer.OrdinalIgnoreCase)
    {
        { "image/bmp" },
        { "image/gif" },
        { "image/heic" },
        { "image/vnd.microsoft.icon" },
        { "image/jpeg" },
        { "image/jpeg" },
        { "image/png" },
        { "image/tiff" },
        { "image/webp" },
    };
f2calv commented 10 months ago

Thanks for raising the issue, this should be fixed with 2.0.2 now released, let me know if still issues... :)