Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not show any picture when opened from app #168

Closed
rugk opened this issue May 10, 2016 · 17 comments
Closed

Does not show any picture when opened from app #168

rugk opened this issue May 10, 2016 · 17 comments

Comments

@rugk
Copy link

rugk commented May 10, 2016

The crash with the content provider is fixed (#148), however when I now open a picture from the other app it just displays me a black screen (with a kind of dark-blue stripe at the top).

BTW: My theme is AMOLED black.

@dnldsht
Copy link
Member

dnldsht commented May 10, 2016

does it crash with all applications or with a specific one?
can you provide the log?

@rugk
Copy link
Author

rugk commented May 10, 2016

Actually it does not crash at all. (If it would I could provide some kind of log...) The crash was already fixed.

So to provide real STR here more information:
I used a non-public beta version of Threema, which uses Content Providers. But probably you can also use the other app @craftyguy mentioned.

So in this app I can pass pictures to a gallery app and when I do so LeafPic only shows me the black screen as described.

@dnldsht dnldsht closed this as completed May 26, 2016
@rugk
Copy link
Author

rugk commented May 28, 2016

@dnldsht Why do you close this issue? Is it fixed?

BTW: I could reproduce it with other apps as well.

@firecat53
Copy link

I also have this issue trying to view pictures from QKSms using Leafpic. Just a blank white panel with a blue bar at the top.

@chesio
Copy link

chesio commented Jun 2, 2016

Hi, I think I have the same issue: trying to open image attachment from K-9 Mail app opens LeafPic, but no image is displayed (only blank white panel and blue bar at the top). On the other hand, any image from folder on SD card that is "known" to LeafPic opens fine from other apps (in my case Total Commander).

I have LeafPic 0.3.5 from F-Droid.

@rugk rugk changed the title Does not show any picture when opend from app (Content Provider) Does not show any picture when opened from app Jun 2, 2016
@rugk
Copy link
Author

rugk commented Jun 2, 2016

So, yeah. This might not have something to do with Content Providers. Or does someone know whether K9 mail and QKSms use it (I doubt so).

So this issue is much more common than I thought.

@PF4Public
Copy link

I have the same issue with LeafPic opening attachments from K-9 Mail.
If I open html attachment with Chrome, it shows url as content://com.fsck.k9.attachmentprovider/........../VIEW. Thus I suppose the same happens to images, which might be unexpected for LeafPic resulting in empty view.

@dnldsht
Copy link
Member

dnldsht commented Jun 16, 2016

Hi guys, new release can you check if there are problems opening media from other apps, I think it is solved (K-9 Mail works). I didn't test MMS because here no one use them and they are quite expensive.
So can someone report apps that have troubles?

@PF4Public
Copy link

Shouldn't it appear in F-droid repository after you release a new version?

@dnldsht
Copy link
Member

dnldsht commented Jun 16, 2016

@PF4Public they update once a day during the night, but I don't when it will be available

@PF4Public
Copy link

I can confirm, that K-9 mail successfully sends attached images to LeafPic without first downloading them, seems fixed to me.

PS: I don't know if that's a bug or not, but homescreen icon didn't change after update.

@firecat53
Copy link

On June 17, 2016 12:38:18 PM PDT, PF4Public notifications@github.com wrote:

I can confirm, that K-9 mail successfully sends attached images to
LeafPic without first downloading them, seems fixed to me.

PS: I don't know if that's a bug or not, but homescreen icon didn't
change after update.


You are receiving this because you commented.
Reply to this email directly or view it on GitHub:
#168 (comment)

Also works now for me with K9 and QKSms.

Thanks,
Scott

@dnldsht
Copy link
Member

dnldsht commented Jun 17, 2016

@PF4Public try to refresh your launcher.

@dnldsht dnldsht closed this as completed Jun 17, 2016
@nickcorona
Copy link

Why do you keep closing this issue? It's not fixed.

@rugk
Copy link
Author

rugk commented Dec 23, 2016

Indeed I can also reproduce this with multiple apps.

However as I see it mostly only happens with big pictures (e.g. taken with the camera apps). Small pictures downloaded from website work however.

@MarcSaric
Copy link

Same here, K9 attachments created with an (iPhone 6 camera) can't be opened. Hardware is a Sony Xperia Z5 Compact, patched to the latest Android (7.0) and K9 Mail version (as of today). Installed LeafPic as a replacement for the anoying Sony-provided Album-App from Google AppStore. Behaviour of LeafPic is otherwise OK (opens images on local and SD-Card storage).

Please reopen this bug. See also #188 .

@emdete
Copy link

emdete commented Mar 24, 2017

the bug still exists. here is a exception stack trace:

03-24 08:13:37.399 27516 27516 W System.err: java.lang.NullPointerException: Attempt to invoke virtual method 'void java.util.ArrayList.add(int, java.lang.Object)' on a null object reference
03-24 08:13:37.399 27516 27516 W System.err: 	at org.horaapps.leafpic.data.Album.<init>(Album.java:75)
03-24 08:13:37.399 27516 27516 W System.err: 	at org.horaapps.leafpic.activities.SingleMediaActivity.onCreate(SingleMediaActivity.java:104)
03-24 08:13:37.399 27516 27516 W System.err: 	at android.app.Activity.performCreate(Activity.java:6679)

looking into the source shows the error:there is a private constructor which has to run to fill class members. this is done by this() in one constructor, the others contain super() instead which circumvents this initialisation. replacing super with this (twice, line 58 and 74) solves the issue.

the second problem is the equal() function further down (line 447) where the path may be null for such cases. i just added && getPath() != null to the condition to prevent another NPE.

now LeafPic can show pictures from apps for me. thank you for providing LeavPic!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants