Google Photos Picker downloads resized image

Hello,

I’m using uppy and companion with Google Photos Picker API, which allows me to select & upload photos to my server. However, these photos come with resized resolution. It looks like it downloads preview image instead of full-sized original file. I couldn’t find anything in documentation if I could specify to retrieve original files.

Does anyone know how this could be fixed?

I use standalone companion server (version 5.5.2). Let me know if you need more details of my setup.

Thank you in advance!

Hi. I cannot reproduce this. When I try to upload an image it is in the full resolution at its destination. Could you point me to a way to reproduce this problem for example on Uppy or some other way?

@mifi Thanks for looking into it. I’m currently working on my local machine, so I’m not sure how could I give my setup for reproducing. But I could give you some details of my setup:

Here is how my javascript look like:

    <script type="module">
        import {
            Uppy,
            Dashboard,
            Webcam,
            XHRUpload,
            GooglePhotosPicker,
            Form
        } from 'https://releases.transloadit.com/uppy/v4.13.4/uppy.min.mjs'

        const uppy = new Uppy({ debug: true, autoProceed: false })
            .use(Dashboard, {
                target: '#photo-uploader',
                inline: true,
                showProgressDetails: false,
                width: '100%'
            })
            .use(GooglePhotosPicker, {
                companionUrl: 'http://localhost:3020',
                clientId: 'my_client_id',
                companionCookiesRule: 'include',
                withCredentials: true,
            })
            .use(Webcam, { target: Dashboard })
            .use(XHRUpload, {
                endpoint: 'my_target_url',
                fieldName: 'file[0]',
                withCredentials: true,
            })
            .use(Form, {
                target: '#fsupload',
            });

        uppy.on('success', (fileCount) => {
            console.log(`${fileCount} files uploaded`)
        })

        uppy.on('complete', (fileCount) => {
            console.log('Completed !', fileCount);
            updateCartBar();
        });
    </script>

I’m not sure, maybe there is some undocumented things I should be aware of? Because right now it looks like it downloads a preview image from Google Photos, not the original one. For example, the photo I download directly from Google Photos is 3000x4000 resolution, but the one I receive to my destination endpoint is 300x400.

Ohh sorry I totally misread. For some reason I thought this was about Google Drive Picker and that’s what I tested. I’ve now tested Google Photos Picker and I can reproduce the problem. When I implemented the plugin initially I assumed that not appending any w or h parameter to the URL would give the original resolution, but that’s clearly not the case. I have made a fix and we hope to get a release soon. Fix google photos picker by mifi · Pull Request #5717 · transloadit/uppy · GitHub

Wow, that was quick! Thank you so much, I really appreciate it @mifi! :heart:

Also, for those who can’t wait for the release, here is a quick workaround (append ‘=d’ once file is added):

        uppy.on('file-added', (file) => {
            if (file.source === 'GooglePhotosPicker') {
                file.remote.body.url = file.remote.body.url + '=d';
            }
        });