signalapp / Signal-Android

A private messenger for Android.
https://signal.org
GNU Affero General Public License v3.0
25.48k stars 6.1k forks source link

Image sending - black #11014

Open snajlcz opened 3 years ago

snajlcz commented 3 years ago

Bug description

While opening image folders show Black thumb and after open any photo samé Black view

Steps to reproduce

Screenshots

Screenshot_20210222_110912_org thoughtcrime securesms

Device info

Device: Huawei p30 Pro Android version: 10.1. Signal version: 5.4.7 (79302)

Link to debug log

https://debuglogs.org/4d1306c33277bd95af4345c466f1a5e2ca76627ccaa64ee41b2b2f2e66104163

hiqua commented 3 years ago

What happens if you try to send these black images (you can send to "Notes to self")?

I tried (I also have black images like you) and it results in a crash (FileNotFoundException in EncryptedCacheDecoder):

https://debuglogs.org/3ac16ed73cda045873c6f58c9a784752a751c8f6ec7e0628d231507fe674ea91

Related:

aeturnum commented 3 years ago

I have a very similar situation with my signal. Here's what I've found:

fatpat commented 3 years ago

try https://github.com/signalapp/Signal-Android/pull/11016

on my P30 pro I had similar issues, since I added this patch, the problem is also gone. Not sure how it's related.

phil8900 commented 3 years ago

I have the exact same issue since I started using Signal like a month ago and it is blocking me from really using it.

Device info Samsung Galaxy S5 DuoS (SM-G900FD) Signal 5.4.7 (793, 79301) Android 10 (lineage_klteduos 10 QQ3A.200805.001)

Link to debug log https://debuglogs.org/ae72d0a95f011cb8f3e013555eddc0de2648fd7725f428c0e536bab6cbce3d50?fbclid=IwAR11K2LahlVypRS-W9g0v72qoBnSPozIHyRrxT1jvd890Njp8G5Dg_5ol2k

snajlcz commented 3 years ago

try #11016

on my P30 pro I had similar issues, since I added this patch, the problem is also gone. Not sure how it's related.

this isnt fix, i now tested, and same problem.

fatpat commented 3 years ago

try #11016 on my P30 pro I had similar issues, since I added this patch, the problem is also gone. Not sure how it's related.

this isnt fix, i now tested, and same problem.

ok, sorry, at least you tried it :-/

snajlcz commented 3 years ago

On update emui 11 problem solved P30pro

cfe84 commented 3 years ago

On update emui 11 problem solved P30pro

That's interesting. I have the exact same issue on a Samsung Galaxy S9, I'm wondering what the source of the problem is. I have noticed another problem - when sharing a picture or video from another app (gallery, ...), the spinner shows for 30s to a minute before I can select a contact to send the picture to. This doesn't do the same on my wife's phone (Galaxy A8).

What's more, waiting sometimes brings some thumbnails, however scrolling down then back up makes them disappear and re-appear randomly.

phil8900 commented 3 years ago

I can verify that the problem persists on my Galaxy S5 DUOS with Signal 5.4.12.

https://debuglogs.org/4fc22ac935aeeec679f3fc568759a8591f62ef63ac04cc72fd0dc8c236939582?fbclid=IwAR382RhsxmJ2BmpkmUJB0tTanSOqAy-3CZGAw2U8AFMdx5wqtz7xO7A4zBk

aeturnum commented 3 years ago

This problem has become less severe recently (the gallery is no longer all black, but it's common for the last few photos to be unloaded black squares for a while).

https://debuglogs.org/68fab74e489f19fe211f9ecfa1f6f30964b11d5e1d720c17213b91ca3c39eee3

clampak commented 3 years ago

That's interesting. I have the exact same issue on a Samsung Galaxy S9, I'm wondering what the source of the problem is. I have noticed another problem - when sharing a picture or video from another app (gallery, ...), the spinner shows for 30s to a minute before I can select a contact to send the picture to. This doesn't do the same on my wife's phone (Galaxy A8).

What's more, waiting sometimes brings some thumbnails, however scrolling down then back up makes them disappear and re-appear randomly.

The same happens on my Galaxy S9, though the spinner doesn't show for all that long. This black thumbnail is a new issue as of a month or two now, it never used to do it. Very frustrating.

q2apro commented 3 years ago

Same here on Honor View 20.

And multiple other phones. See also Reddit thread: https://www.reddit.com/r/signal/comments/kk1qka/black_ghost_images_after_moving_files/

Please try to fix this. This bug should have high priority.

clampak commented 3 years ago

I just updated my Galaxy S9 from Android 10 update 29 to update 30, and the issue is gone.

So, Baseband version G960USQS9FUB2.

Hope this helps some folks.

UserX404 commented 3 years ago

This issue seems to be already monitored at https://github.com/signalapp/Signal-Android/issues/11074 and a possible fix has already be found for the image library. https://github.com/bumptech/glide/issues/4517 https://github.com/bumptech/glide/commit/042f6b57d511c9d1652d280f5d385d5fef071647

It seems we has to wait for the next glide release.

varac commented 3 years ago

Similar issue: #11212

Possible workaround: Reducing the picture size for new pictures taken with the camera app down to 2.1 megapixel "fixed" it for me (although this is just a temporary stop-gap measure until this gets fixed properly).

phil8900 commented 3 years ago

Updating to Lineage 18.1 solved the issue for me!

varac commented 3 years ago

Updating to Lineage 18.1 solved the issue for me!

Not for me, I'm on Lineage 18.1 and Pictures >2.1 megapixel still show up black when selecting from the gallery.

ErikSkinnari commented 3 years ago

Have this issue too. Oneplus 6, Android 10, OxygenOS 10.3.11.

All image thumbnails are black in Signal. So it is very difficult to select what image to share. But the images is shared correctly if You know which image to tap on.

mklilley commented 3 years ago

I have this problem on Oneplus 5, Android 10, OxygenOS 10.0.1. I am using Signal version 5.21.5. I find the black thumbnail problem is sporadic and have not managed to identify what causes it and when. The only fix I find when it happens is to restart my phone. This does seem to have been going on for a while - is there a roadmap in which this bug sits? Thanks for your help.

ErikSkinnari commented 3 years ago

For me it has been fixed. @mklilley Do not see any black thumbnails anymore.

But I do get some random blur/color overlay on parts of the image thumbnails in the chat on images I have sent. But if I click the image it is shown correctly. I'm on version 5.20.4

aeturnum commented 3 years ago

It also seems fixed for me and, I believe, has been for some time. I'm on version 5.21.6 and on an unmodified Samsung Galaxy S9.

grzesie commented 2 years ago

I am using app version 5.24.17 on OnePlus 5T (original Oxygen 10.0.1, android 10). Still seeing black thumbnails.

stale[bot] commented 2 years ago

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

irisv commented 2 years ago

I'm still experiencing this issue. Please reopen it. Motorola One, android 10, Signal 5.40.4 Sometimes sharing from another app works, but often even with that workaround pics are never sent. Screenshot_20220610-201635

cody-signal commented 2 years ago

What are the file types of the images you are trying to preview?

irisv commented 2 years ago

What are the file types of the images you are trying to preview?

The screenshot I attached is from the Camera folder, ie the photos taken with my phone's camera; those are jpg with the occasional mp4 video (like the second item on the fifth row of the screenshot, marked with the triangular video icon). But if I access, for example, the download folder, there are more mixed files, but again the same black thumbnails. My phone saves screenshots like the one above as png, and again, black thumbnails.

But just as the OP, I do get one or two thumbnails occasionally. It doesn't seem linked to a specific file type. My impression is that Signal tries to create thumbnails for a fraction of a second, stops well before that process is anywhere near done, and any images that aren't covered in that time, are never attempted again.

cody-signal commented 2 years ago

Thanks for the extra details. Android and HEIC have historically not gotten along so wanted to check. Can you provide an updated debuglog after viewing the gallery?

irisv commented 2 years ago

Thanks for picking this up.

Here's what I did: I force closed Signal, cleared the cache, opened the app, went to the Note to self conversation, hit the blue + button, then gallery, then Camera -- which gave me all black thumbnails, I selected the first image and tried to send it, let Signal work on that for a minute or two, lost patience and backed out to go get the log.

It's here:

https://debuglogs.org/android/5.40.4/57b6f3baae397a9e8652b64c2e0394a54ebc769c0599b4d3aae357c06e88af7f

Hope that helps!

greyson-signal commented 2 years ago

@irisv For context, your log is filled with a lot of this:

[5.40.4] [main ] 2022-06-13 17:42:27.317 GMT+02:00 W FileViewHolder          Failed to load media.
[5.40.4] [main ] 2022-06-13 17:42:27.317 GMT+02:00 W FileViewHolder          class com.bumptech.glide.load.engine.GlideException: Failed to load resource
[5.40.4] [main ] 2022-06-13 17:42:27.317 GMT+02:00 W FileViewHolder            Cause (1 of 1): class com.bumptech.glide.load.engine.GlideException: Failed LoadPath{AutoCloseInputStream->Object->Drawable}, LOCAL
[5.40.4] [main ] 2022-06-13 17:42:27.317 GMT+02:00 W FileViewHolder              Cause (1 of 4): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{AutoCloseInputStream->APNGDecoder->Drawable}
[5.40.4] [main ] 2022-06-13 17:42:27.317 GMT+02:00 W FileViewHolder              Cause (2 of 4): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{AutoCloseInputStream->GifDrawable->Drawable}
[5.40.4] [main ] 2022-06-13 17:42:27.317 GMT+02:00 W FileViewHolder              Cause (3 of 4): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{AutoCloseInputStream->Bitmap->Drawable}
[5.40.4] [main ] 2022-06-13 17:42:27.317 GMT+02:00 W FileViewHolder              Cause (4 of 4): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{AutoCloseInputStream->BitmapDrawable->Drawable}

Which is to say that Glide has no idea how to load the media file. We'll think on this and see if there's any other debuginfo we could get. In the meantime, if one of these files are shareable, it'd be cool to get a copy of one to see if we can reproduce. You can email it to greyson@signal.org (I'd recommend uploading it to a filesharing service like GDrive or Dropbox to ensure it isn't compressed). Thanks!

irisv commented 2 years ago

Which is to say that Glide has no idea how to load the media file. We'll think on this and see if there's any other debuginfo we could get. In the meantime, if one of these files are shareable, it'd be cool to get a copy of one to see if we can reproduce. You can email it to greyson@signal.org (I'd recommend uploading it to a filesharing service like GDrive or Dropbox to ensure it isn't compressed). Thanks!

I don't think it's linked to any specific files or filetypes, because sometimes the thumbnails show up and sometimes they don't. Sometimes it's none at all like in my screenshot above, sometimes it's a couple of pics seemingly at random like in the OP's screenshot, and sometimes I get lucky and most show up. Thumbnails I've definitely seen before, are gone again an hour later. So it's not as if it a specific file or filetype Signal can't read - sometimes it can, sometimes it can't.
For example, when I first tried to get a log, I did the same as I described above: force closed the app, cleared the cache, started the app, opened a conversation, opened the gallery - and then Signal kept crashing and crashing and crashing. So I restarted my phone, opened Signal again, and hey presto: thumbnails galore! Typical, just when you want to show what's wrong, everything works... But of course the fix only lasted a very short time, and as soon as it was all black thumbs again, I got the debuglog above.

Things seem to work better immediately after I've restarted my phone, so I did that again just now and got another log for comparison: https://debuglogs.org/android/5.40.4/d6259d0334cd537393ccd83fa0a6d52d25ec01846ad8230e0dfac58259607121 - though it still has a lot of those same Failed to load media errors. And needless to say, I don't want to have to restart my phone each time I want to send a photo with Signal.

Anyway, I'll send you a link to the original file of the screenshot I shared above, in case it helps.

Hnasar commented 2 years ago

I've also had this issue for years:

https://debuglogs.org/android/5.41.10/4aaccc99d996ebd47ed2045eb19849a48519cac7a3a4e707f01a55a65fa2aff6

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

irisv commented 2 years ago

Bump!

alex-signal commented 2 years ago

If people are still experiencing this on newer versions of Signal, please include new logs. Our logs expire after 30 days or so, and fresh logs can help give us a bigger picture of what is happening and help diagnose the issue. There are some relevant open tickets on Glide, so I'm not currently convinced that this is solvable on our part (without updating some dependencies.)

Our Glide version is 4.11, and the newest is 4.13. However, reading through glide issues it seems 4.12 introduced some broken behavior. Our exifinterface dependency is also quite out of date (1.0.0 vs 1.3.3) so once I have a chance to talk to the guys about why these haven't moved, I'll see about updating these dependencies for the next beta, and we'll see if we can't see some movement here.

irisv commented 2 years ago

Yup, still experiencing the same issue: Screenshot_20220831-145047

Here's my log : https://debuglogs.org/android/5.47.3/94e788fdcbec11ab120a72e73a64b9d75c4403b3a4d069e2f216b855d3f78228

UserX404 commented 2 years ago

potential fixed with 5.48 https://github.com/signalapp/Signal-Android/commit/4baa7527f71fb0e307fb4322863233e5bbeba7be

alex-signal commented 2 years ago

Definitely please let me know if there are any changes here with that update.

irisv commented 2 years ago

Definitely please let me know if there are any changes here with that update.

Will do! I've rejoined the beta -- or is it better to wait for the main release?

alex-signal commented 2 years ago

@irisv Up to you, the beta is a beta, so there is an acknowledgement that there will be bugs and other issues that don't normally make it through to a production release.

irisv commented 2 years ago

The app now reports version 5.49.1 and the issue persists.

https://debuglogs.org/android/5.49.1/01b38437efd397cc0d080f5eb95874965e827add5fc729df23f5fde29294cb0f

alex-signal commented 2 years ago

@irisv Thanks! Do you mind providing your phone model? I see it's a Motorola One but I see there are multiple phones with that name. Might be time for me to order a test device.

Can other folks please comment which device this is occurring on? I'll see if I can't reproduce it somehow, ideally with a device I already have access to.

irisv commented 2 years ago

Mine's a Motorola One XT1941-4. I believe it was one of the earliest Android One phones by Motorola. It's not rooted but I do have developer options turned on. Android build is on QPKS30.54-22-27.

Fishermanjb commented 1 year ago

Having the same problem on a Galaxy A53, Model number SM-A536B/DS

but for me it's just the .heic files Signal can't load, all the other pictures are working.

fatpat commented 1 year ago

Same here with a huawei P30 pro and a P30 also.

It's the same for at least 2 years

BenBen244 commented 1 year ago

Same problem here - its a Google Pixel 7 pro. I couldn't find a way to add pictures to Signal from the phones gallery. I see only the black thumbnails as well. Since this problem is 2 years old I guess we can expect this wont get fixed.

nicholas-signal commented 1 year ago

We rely on the Glide image library to populate this images. Glide can have issues with unusual or newer image formats, such as HEIF or DNG. We adopt new versions of Glide as they are released.

If you find images that are incompatible with Glide, we will be waiting on Glide to eventually support them.

irisv commented 1 year ago

We rely on the Glide image library to populate this images. Glide can have issues with unusual or newer image formats, such as HEIF or DNG. We adopt new versions of Glide as they are released.

That's not the whole issue though. As stated above, I'm experiencing this issue with .jpg photos and .mp4 videos taken with my phone's camera, and .png screenshots. Those formats aren't unusual or new.

Also, sometimes I get to see some thumbnails, sometimes none at all. Thumbs I've seen before might be gone the next time and vice versa. This would suggest the file or format isn't the issue.

BenBen244 commented 1 year ago

Some more hints: in my case Signal shows in the gallery that was created in the last years up to end of December 2022. But from later created pictures maybe just 10% is shown. I dont think its about the file type. As an example: in the "OpenCamera" folder all pictures have the same type, but just 10% have a thumbnail, all other are just black. (I scratch my head, but I'm not sure: potentially the pictures are shown that I edited and saved again after I took them).

fatpat commented 1 year ago

same here, to me this is not related to the file type.

maybe this is related to the number of photos to load ...

joshyy1312 commented 1 year ago

It seems related to filesize, but not only to that.

I had a 6.2mb png that didn't show and appeared instantly when converted to a 1.08mb jpeg.

Other png's from the same batch I copied to the phone showed, but only those under 4.5mb.

I previously copied pngs of more than 6mb and had no problems...