apps-android-commons icon indicating copy to clipboard operation
apps-android-commons copied to clipboard

[Bug]: When I select two images, the system tries to upload four—the RAW version fails (I always save both a JPG and a RAW version of each photo

Open OpenGreenStreet opened this issue 5 months ago • 13 comments

Summary

For many years, I’ve been saving both a JPG version and a RAW version of every photo I take. Since Commons App 6.6.0, the RAW files are automatically selected as well, and the upload naturally fails.

Steps to reproduce

I’ve had the same problem (selecting one image but sending two that appear to be identical) when sending photos via various messaging services. I reported this to Google for Android 16 in May (?) 2026. Since I’ve been using Android 17 for a few weeks now, only one image is being sent (again) via messaging services. The problem persists with the Commons app.

Expected behaviour

Select a photo and only one photo will be attempted to upload

Actual behaviour

the RAW files are automatically selected as well, and the upload naturally fails.(Screenshots will follow later)

Device name

Google Pixel 7 Pro

Android version

Android 17

Commons app version

6.6.0~null

Device logs

No response

Screenshots

No response

Would you like to work on the issue?

None

OpenGreenStreet avatar Jun 27 '26 14:06 OpenGreenStreet

Image Image Image

OpenGreenStreet avatar Jun 27 '26 14:06 OpenGreenStreet

Does the first screenshot show Google Photos? Or is it the system picker?

Can you post a screencast showing your full workflow?

nicolas-raoul avatar Jun 27 '26 20:06 nicolas-raoul

The first screenshot shows Google Photos

And yes, now I remember—that was also the workaround for Messenger: if I selected the photos directly from Messenger, the problem didn't occur!

OpenGreenStreet avatar Jun 28 '26 05:06 OpenGreenStreet

Is that answer good enough for you?

OpenGreenStreet avatar Jun 28 '26 05:06 OpenGreenStreet

The reason is that, in my opinion, Google Photos is much more convenient than the system picker. I find it faster and easier to find photos (maybe because I'm used to it). It's my go-to tool...

The screenshot below shows the same selection using the system picker

Image

OpenGreenStreet avatar Jun 28 '26 05:06 OpenGreenStreet

A correction and a clarification:

  • The problem persists with Android 17 when using messaging apps (Correction)

• In my experience, this only occurs when using multiple selections in Google Photos • * If I select only one photo, the app does not attempt to upload the RAW version • If there are several different edits (versions) of a photo, all of them are uploaded

OpenGreenStreet avatar Jun 28 '26 19:06 OpenGreenStreet

@OpenGreenStreet please how do I get the RAW image of an image ? What do you use for that ?

benndip avatar Oct 18 '26 15:10 benndip

@benndip In the settings of the Google camera app, I selected RAW+JPEG via the "Pro" settings.

OpenGreenStreet avatar Oct 18 '26 17:10 OpenGreenStreet

I'd like to work on this. Could this be assigned to me?

I reproduced it on an Android 16 emulator. I put two RAW+JPEG pairs (.dng + .jpg) in DCIM/Camera, selected all four in the Files app and shared them to Commons. The app accepted all four and copied both .dng files into its upload folder (cache/CommonsContributions/). DNG isn't an allowed file type on Commons, so those uploads can only fail.

The cause is in FilePicker.getFilesFromGalleryPictures(): files shared from other apps are added without any type check, and the manifest's image/* share filter lets image/x-adobe-dng through. The in-app gallery picker already limits MIME types, so only the share path is affected. This code didn't change in 6.6.0, so the timing likely comes from Google Photos starting to share both files of a RAW+JPEG pair.

Proposed fix: skip shared files whose type Commons doesn't accept (reusing the gallery picker's list, with HEIC still converted to JPEG), show a short message saying how many files were skipped and why, and add unit tests for the filtering. Happy to adjust if you'd prefer a different behaviour, e.g. a dialog listing the skipped files.

yuvarajvodiboina avatar Oct 21 '26 04:10 yuvarajvodiboina

@yuvarajvodiboina also I think to reproduce the actual issue, you needed to select just the 2 .jpg images and see if the 4 images (.jpg and .dng files) will show in the commons app, as that's exactly what the Bug specifies.

But your fix could solve that also 😇

benndip avatar Oct 21 '26 04:10 benndip

Thanks for assigning this, and thanks @benndip for the note.

It looks like #6825, merged shortly after I was assigned, already covers this issue. Looking at the merged code, receiveSharedItems() now drops any shared file whose MIME type isn't JPEG, PNG, SVG or Ogg and shows the "Unsupported Files Skipped" dialog. A RAW file shared alongside its JPEG has its own RAW type, so it gets filtered out there. I checked this by sharing a JPEG plus its RAW from Google Photos on an emulator: Google Photos reports the RAW item with a RAW type, not JPEG, even though the share itself is labelled image/jpeg.

@benndip: the doubling happens inside Google Photos before Commons receives anything, so filtering the received files covers it either way.

So I think this can be closed as fixed by #6825. One small difference from the fix I had prepared: #6825 filters after the files have been copied into the app's cache, so a large RAW file (12 MB in my test) is still copied before being dropped. If you'd like, I can open a small follow-up that checks the type before copying. Otherwise I'll leave it here.

yuvarajvodiboina avatar Oct 21 '26 08:10 yuvarajvodiboina

@yuvarajvodiboina Sorry for that! Yes, this improvement sounds great, thanks! 🙂

nicolas-raoul avatar Oct 21 '26 09:10 nicolas-raoul

No problem at all, @nicolas-raoul! I've opened #7069 for the follow-up. Shared files in a format Commons doesn't accept, such as RAW, are now skipped before they are copied, and the dialogs from #6825 still show as before. On an emulator, sharing two RAW+JPEG pairs used to copy both 12.6 MB RAW files into the app's cache; now only the JPEGs are copied.

CI is waiting for a maintainer to approve the workflows, since this is my first PR here.

yuvarajvodiboina avatar Oct 21 '26 10:10 yuvarajvodiboina