Piwigo-Android icon indicating copy to clipboard operation
Piwigo-Android copied to clipboard

no Pictures shown in Android App

Open Dino0811 opened this issue 5 years ago • 11 comments

Describe the bug and how to reproduce I can't see any picture in android app, not for the album, not in an album.

Expected behavior If i open the android app i can see my albums (text but no galery image), i can go into the album but won't see an image - just (for example an album with 4 pictures) can see 4 white sqares.

What did you do already

  • Problem is on my Samsung Galaxy S10 (Android 10 with latest Piwigo-Android (1.0.2))
  • tried on my fathers Android tablet (HUAWEI MEDIAPAD M3 LTE, Android unknown with latest Piwigo-Android (1.0.2))

Screenshots ...

Smartphone (please complete the following information): -> "what did you already"

Additional context my piwigo-server is set up as docker (linuxserver/piwigo) and i use an letsencrypt/ngix-reverse proxy, so i can access all my dockers by subdomain.domain.de

Dino0811 avatar Aug 12 '20 10:08 Dino0811

same issue here, nokia 8 / android 9, piwigo docker isntallation with treafik 2.0 reverse proxy.

DocEverdream avatar Aug 17 '20 18:08 DocEverdream

For me this looks like a duplicate of #184, can you check the details there? - In my eyes the issue is, that the URLs of the pictures are returned with HTTP - without "s" in case you put piwigo behind the revers-proxy. In my eyes this is a security flaw, as it exposes which images are viewed without encryption and should be fixed by patching the REST-return data in the reverse-proxy or in piwigo core.

Next Piwigo-Android version will likely hide the issue by loading the HTTP-URLs. In case the reverse-proxy is setup correctly it should redirect to the https variant which will at least secure the image transfer.

ramack avatar Aug 18 '20 17:08 ramack

Hi,

thank's for the hint...this seems to be the problem!

this https://github.com/Piwigo/Piwigo-Android/issues/184#issuecomment-640928300 helped me (quick and dirty) - pictures are shown, but upload doesn't work.

hopefully the fixed android-app will be out soon :) - thanks!

Dino0811 avatar Aug 20 '20 06:08 Dino0811

Ok, reading through the code I've found "webservicefactory" which crafts the requests and can be initialized to use account login data (e.g. cookie) when sending a request to the server.

The ImageRESTrepository uses this class and communicates as useragent "Piwigo Android 1.0.x" , the downloadFileAtUrl somehow takes a different piece of code execution: it communicates as "okhttp ....". The first I'm not sure but the latter definitely misses to send the cookie of the logged in user with the GET request.

How can this be added/extended in WebserviceFactory class? Can you please point me to or just add the two lines.?

Getting this in would make piwigo Android compatible with the piwigo privacy plugin (run via nginx in in advanced mode) and not break any default "piwigo product" behaviour because a pc browser (like firefox, chrome) already works because it sends the cookies with every php/js/css/jpg/... along by default which the android app doesn't (when using okhttp).

I've verified this working by temporarily allowing the okhttp useragent without going through the authentication check (php on server modified for testing in private lan zone). The app loaded all thumbs and pictures full size correctly then.

Thank you.

Catfriend1 avatar Sep 06 '20 13:09 Catfriend1

Sorry for the long time till response...

The issue doesn't look like being located in the WebServiceFactory for me. I guess it is in the picasso, which creates it's own okhttp instance when created in ApplicationModule.providePicasso().

ramack avatar Nov 09 '20 20:11 ramack

Ok, I hope a fix is possible.

Catfriend1 avatar Jan 07 '21 23:01 Catfriend1

I had this same issue when using a reverse proxy : Internet -> HTTPS -> HTTP. I finally found a fix to this to wait until the next release. Within local/config/config.inc.php :

$_SERVER['HTTPS']='on';
$_SERVER['SERVER_PORT']=443;
$conf['gallery_url'] = "https://myserver.lo";`

chuugar avatar Feb 09 '21 07:02 chuugar

Thanks a lot Chuugar !

guiyou65 avatar Mar 01 '21 08:03 guiyou65

I don't see any pictures, neither in the the old version, nor in the NG-version. Testing on a Sony Xperia with Android 8.0.0 BTW The IOS-version works like a charm ...

Maybe the issue is related to the way https is implemented on the server? https://piwigo.org/forum/viewtopic.php?id=29002

Binero has configured their environment in a way that gives PHP the following data:

 $_SERVER['HTTPS'] = 'on'
 $_SERVER['SERVER_PORT'] = 80

The fix to be able to log in:

I've created two files in: ~/mydomain.com/public_html – first (the hidden) ".user.ini":

; Fix SERVER_PORT making redirects work in Piwigo. auto_prepend_file = /storage/content/96/******/mydomain.com/public_html/https_port_fix.php

... and second: "https_port_fix.php":

havet avatar Jul 01 '21 07:07 havet

I upgraded to Piwigo 13.5.0 and the plugin "piwigo_privacy" was disabled, because it was considered incompatible with this version . Now suddenly I could see a few pictures with the Android app Piwigo NG, but the majority of pictures where still invisible. I had some indications that only cached images where visible.

Unfortunately, now Piwigo worked miserably in my browser: only a few cached images where displayed. The same applied to the app for Iphone/iPad, that used to work excellently.

Now I've enabled the plug-in again and Piwigo works as charm in both browser and as iPhone app. But unfortunately, the Android app only works for public albums. Albums protected with any of the schemes to restrict access to some of the users after log-in are still inaccessible.

havet avatar Feb 22 '23 16:02 havet

This is a very old bug. I stopped using the app when the mobile version of the browser worked impeccably.

I am hosting the Piwigo server myself behind a reverse NAT proxy with Apache. It appears that the app is incapable of handling the reverse proxy requests while the browser is.

It would be nice to see this solved and have an app opening your files, but you can set a shortcut with the browser to do the same thing. I won't hold my breath and I have actually given up on this one.

bhlevca avatar Sep 04 '23 01:09 bhlevca