Owncloud Android App can't see Thumbnails of images located on some external storage in 8.2.1- 8.2.2 - 9.0.0 #21173

Closed
tigermick opened this Issue Dec 13, 2015 · 84 comments

Projects

None yet

9 participants

@tigermick

Steps to reproduce :

Browse photo directories in external storage in Owncloud official app 1.9.0
    Only placeholder is shown
    Not Thumbnails in external storage on official android app - Works fine directly from web browser (Like Firefox)
    Thumbnails work fine out of the external storage on official android app
    Thumbnails work fine in external storage with Web browser

My external storage is just another local folder in the same owncloud's server

Expected behaviour :

There is a thumbnail.

Actual behaviour :

Placeholder icon is shown

Operating system:

Debian Jessie (8.0)

Web server:
Apache

Database:
MySQL

PHP version:
5.6.14

ownCloud version: 8.2.1(stable)

Owncloud log :
{"reqId":"qvwmBaQX\/gQVUzWPBpx5","remoteAddr":"192.168.0.254","app":"core","message":"Generating preview for \"files\/DonneesReseaux\/DessinsPerso\/Euro2008.png\" with \"OC\\Preview\\PNG\"","level":0,"time":"2015-12-13T21:43:27+00:00","method":"GET","url":"\/owncloud\/index.php\/apps\/files\/api\/v1\/thumbnail\/448\/448\/DonneesReseaux\/DessinsPerso\/Euro2008.png"} {"reqId":"qvwmBaQX\/gQVUzWPBpx5","remoteAddr":"192.168.0.254","app":"core","message":"OC_Image->fixOrientation() Image is not a JPEG.","level":0,"time":"2015-12-13T21:43:27+00:00","method":"GET","url":"\/owncloud\/index.php\/apps\/files\/api\/v1\/thumbnail\/448\/448\/DonneesReseaux\/DessinsPerso\/Euro2008.png"} {"reqId":"qvwmBaQX\/gQVUzWPBpx5","remoteAddr":"192.168.0.254","app":"core","message":"OC_Image->fixOrientation() Orientation: -1","level":0,"time":"2015-12-13T21:43:27+00:00","method":"GET","url":"\/owncloud\/index.php\/apps\/files\/api\/v1\/thumbnail\/448\/448\/DonneesReseaux\/DessinsPerso\/Euro2008.png"} {"reqId":"KxfNYjDs5j8L7qHjhX8D","remoteAddr":"192.168.0.254","app":"core","message":"Generating preview for \"files\/DonneesReseaux\/DessinsPerso\/FondEcranCroixSmartphoneSansPhoto.png\" with \"OC\\Preview\\PNG\"","level":0,"time":"2015-12-13T21:43:28+00:00","method":"GET","url":"\/owncloud\/index.php\/apps\/files\/api\/v1\/thumbnail\/448\/448\/DonneesReseaux\/DessinsPerso\/FondEcranCroixSmartphoneSansPhoto.png"} {"reqId":"KxfNYjDs5j8L7qHjhX8D","remoteAddr":"192.168.0.254","app":"core","message":"OC_Image->fixOrientation() Image is not a JPEG.","level":0,"time":"2015-12-13T21:43:28+00:00","method":"GET","url":"\/owncloud\/index.php\/apps\/files\/api\/v1\/thumbnail\/448\/448\/DonneesReseaux\/DessinsPerso\/FondEcranCroixSmartphoneSansPhoto.png"} {"reqId":"KxfNYjDs5j8L7qHjhX8D","remoteAddr":"192.168.0.254","app":"core","message":"OC_Image->fixOrientation() Orientation: -1","level":0,"time":"2015-12-13T21:43:28+00:00","method":"GET","url":"\/owncloud\/index.php\/apps\/files\/api\/v1\/thumbnail\/448\/448\/DonneesReseaux\/DessinsPerso\/FondEcranCroixSmartphoneSansPhoto.png"} {"reqId":"PfoWr48VV4NyRVJCDyhv","remoteAddr":"192.168.0.254","app":"core","message":"Generating preview for \"files\/DonneesReseaux\/DessinsPerso\/logo.png\" with \"OC\\Preview\\PNG\"","level":0,"time":"2015-12-13T21:43:28+00:00","method":"GET","url":"\/owncloud\/index.php\/apps\/files\/api\/v1\/thumbnail\/448\/448\/DonneesReseaux\/DessinsPerso\/logo.png"} {"reqId":"PfoWr48VV4NyRVJCDyhv","remoteAddr":"192.168.0.254","app":"core","message":"OC_Image->fixOrientation() Image is not a JPEG.","level":0,"time":"2015-12-13T21:43:28+00:00","method":"GET","url":"\/owncloud\/index.php\/apps\/files\/api\/v1\/thumbnail\/448\/448\/DonneesReseaux\/DessinsPerso\/logo.png"} {"reqId":"PfoWr48VV4NyRVJCDyhv","remoteAddr":"192.168.0.254","app":"core","message":"OC_Image->fixOrientation() Orientation: -1","level":0,"time":"2015-12-13T21:43:28+00:00","method":"GET","url":"\/owncloud\/index.php\/apps\/files\/api\/v1\/thumbnail\/448\/448\/DonneesReseaux\/DessinsPerso\/logo.png"} {"reqId":"CUZ+fj5crMxsSrxA6kG7","remoteAddr":"192.168.0.254","app":"core","message":"Generating preview for \"files\/DonneesReseaux\/DessinsPerso\/PtitCoeur.png\" with \"OC\\Preview\\PNG\"","level":0,"time":"2015-12-13T21:43:29+00:00","method":"GET","url":"\/owncloud\/index.php\/apps\/files\/api\/v1\/thumbnail\/448\/448\/DonneesReseaux\/DessinsPerso\/PtitCoeur.png"} {"reqId":"CUZ+fj5crMxsSrxA6kG7","remoteAddr":"192.168.0.254","app":"core","message":"OC_Image->fixOrientation() Image is not a JPEG.","level":0,"time":"2015-12-13T21:43:29+00:00","method":"GET","url":"\/owncloud\/index.php\/apps\/files\/api\/v1\/thumbnail\/448\/448\/DonneesReseaux\/DessinsPerso\/PtitCoeur.png"} {"reqId":"CUZ+fj5crMxsSrxA6kG7","remoteAddr":"192.168.0.254","app":"core","message":"OC_Image->fixOrientation() Orientation: -1","level":0,"time":"2015-12-13T21:43:29+00:00","method":"GET","url":"\/owncloud\/index.php\/apps\/files\/api\/v1\/thumbnail\/448\/448\/DonneesReseaux\/DessinsPerso\/PtitCoeur.png"} {"reqId":"C3fC8nRYyW+OxJYqPNd7","remoteAddr":"192.168.0.254","app":"core","message":"Generating preview for \"files\/DonneesReseaux\/DessinsPerso\/SmileyCoeur2.png\" with \"OC\\Preview\\PNG\"","level":0,"time":"2015-12-13T21:43:30+00:00","method":"GET","url":"\/owncloud\/index.php\/apps\/files\/api\/v1\/thumbnail\/448\/448\/DonneesReseaux\/DessinsPerso\/SmileyCoeur2.png"} {"reqId":"C3fC8nRYyW+OxJYqPNd7","remoteAddr":"192.168.0.254","app":"core","message":"OC_Image->fixOrientation() Image is not a JPEG.","level":0,"time":"2015-12-13T21:43:30+00:00","method":"GET","url":"\/owncloud\/index.php\/apps\/files\/api\/v1\/thumbnail\/448\/448\/DonneesReseaux\/DessinsPerso\/SmileyCoeur2.png"} {"reqId":"C3fC8nRYyW+OxJYqPNd7","remoteAddr":"192.168.0.254","app":"core","message":"OC_Image->fixOrientation() Orientation: -1","level":0,"time":"2015-12-13T21:43:30+00:00","method":"GET","url":"\/owncloud\/index.php\/apps\/files\/api\/v1\/thumbnail\/448\/448\/DonneesReseaux\/DessinsPerso\/SmileyCoeur2.png"} {"reqId":"0h45oTMfydQVuZWYy+32","remoteAddr":"192.168.0.254","app":"core","message":"Generating preview for \"files\/DonneesReseaux\/DessinsPerso\/WorldCup2010.png\" with \"OC\\Preview\\PNG\"","level":0,"time":"2015-12-13T21:43:30+00:00","method":"GET","url":"\/owncloud\/index.php\/apps\/files\/api\/v1\/thumbnail\/448\/448\/DonneesReseaux\/DessinsPerso\/WorldCup2010.png"} {"reqId":"0h45oTMfydQVuZWYy+32","remoteAddr":"192.168.0.254","app":"core","message":"OC_Image->fixOrientation() Image is not a JPEG.","level":0,"time":"2015-12-13T21:43:30+00:00","method":"GET","url":"\/owncloud\/index.php\/apps\/files\/api\/v1\/thumbnail\/448\/448\/DonneesReseaux\/DessinsPerso\/WorldCup2010.png"} {"reqId":"0h45oTMfydQVuZWYy+32","remoteAddr":"192.168.0.254","app":"core","message":"OC_Image->fixOrientation() Orientation: -1","level":0,"time":"2015-12-13T21:43:30+00:00","method":"GET","url":"\/owncloud\/index.php\/apps\/files\/api\/v1\/thumbnail\/448\/448\/DonneesReseaux\/DessinsPerso\/WorldCup2010.png"}

@PVince81 PVince81 added this to the 9.0-current milestone Dec 14, 2015
@PVince81
Collaborator

Can you tell us more about that external storage ? What kind is it ?

@georgehrke @oparoz any idea regarding the previews on external storage ?

@tigermick

In my server, Owncloud is in /var/www/ and I have a media folder in /media/
I use external storage application to add my media folder in my owncloud but this is just a local folder.
All works fine with web owncloud interface ...
If I browse photo directorie in external storage with web owncloud interface and immediatly after, I browse too with android official app in the same photo directorie, thumbnails display.
But If I browse only with android official app, thumbnails don't display.

Sorry for my bad english ; tell me if it's not understandable...

@PVince81
Collaborator

@tigermick okay, so you used the external storage of type "Local". Thanks

@tigermick

Yes, do you have an idea about this problem please ?

@oparoz
Contributor
oparoz commented Dec 14, 2015

We've heard of this problem before. It sounds like the endpoint used by the Android API does not trigger the preview generation mechanism. Maybe a missing hook or the thumbnails API is calling the wrong Preview method?

@tigermick

How to i can correct this problem ?

@tigermick

Any news to fix this problem please ?

@tigermick

I have updated my OC to 8.2.2 and I have the same problem again.

@PVince81
Collaborator

@davivel did you observe this issue before ?

@tigermick

Hi
No, I think before 8.1, all worked fine with owncloud application. I don't why this bug appears now ...

@davivel
Member
davivel commented Feb 16, 2016

There was other problem in the past with the automatic generation of thumbnails defaulting to the placeholder icon. Not sure if related with this or not.

The entry point we call in the server side is /index.php/apps/files/api/v1/thumbnail/[width]/[height]/[file_path] ; I don't know who implemented it, I'd say it was a contribution, maybe from @tobiasKaminsky? , he implemented the remote thumbnails in the Android app.

@davivel
Member
davivel commented Feb 16, 2016

Those logs were caught before or after "fixing" the thumbnails by accessing via web interface first? Seems they are generated in https://github.com/owncloud/core/blob/c5a200c4198de951dabdd3f783ade655b8ea6434/lib/private/preview/image.php#L59 , so the preview generation is being triggered, right?

@tobiasKaminsky
Contributor

Yes, @davivel is correct.

@lgg42
lgg42 commented Feb 21, 2016

Hello!! Another user here having the same problem. OC version: 8.2.1
My problem with thumbnail generation is also only with external storage (system folder like /media/pictures). On the web interface, everything works OK. On android, I've tried both, the official app 1.9.1 and Cirrus 1.0.2, and I don't get the thumbnail for external storage, only the placeholder icon.

But I've found out something interesting, this issue only happens on images belonging to folders being the last ones in the directory tree.

For explaining myself better, if I get into this "Variadas" folder within my external storage

Variadas/
├── 100_0331.jpg
├── 100_0421.jpg
├── 100_0426.jpg
├── dscn1664.jpg
├── dscn1666.jpg
├── Gcafe
│   ├── P8070030.JPG
│   ├── P8070031.JPG
│   ├── P8070032.JPG
│   └── P8070033.JPG
├── hpim0749.jpg
├── Imagen\ 030.jpg
├── Imagen\ 033.jpg
├── Imagen\ 077.jpg
├── IMG_1360.JPG
├── IMG_1361.JPG
├── Manana
│   ├── P1010233.JPG
│   ├── P1010234.JPG
│   ├── P1010235.JPG
│   ├── P1010236.JPG
│   ├── P1010237.JPG
│   ├── P1010238.JPG
│   ├── P1010239.JPG
│   ├── P1010240.JPG
│   ├── P1010241.JPG
│   ├── P1010242.JPG
│   └── P1010243.JPG
├── sedado.jpg
└── Thumbs.db

I get the thumbnails for any image inside "Variadas", like 00_0331.jpg or dscn1664.jpg, in both Android apps. BUT, if I enter either folder "Gcafe" or "Manana" I get no thumbnail at all.

If I directly make the request /index.php/apps/files/api/v1/thumbnail/[width]/[height]/[file_path] on the browser, I get:

{"message":"File not found."}

Following another thread , it also happens that if I previously generated the thumbnails in the browser, the android app can display them.

@oparoz
Contributor
oparoz commented Feb 22, 2016

Could people experiencing the issue add this to their config files?

'filesystem_check_changes' => 2,

@lgg42
lgg42 commented Feb 22, 2016

@oparoz I tried after your comment and still not having thumbnails generated,
Did this config option worked for you?

Thanks!

@oparoz
Contributor
oparoz commented Feb 22, 2016

Did this config option worked for you?

I did not test it, but it's a setting which was introduced in 8.2 to minimize requests made to the filesystem.

If you've attached the folder using the files_external app, you need to change the setting there as well, as each "mounted" folder has its own settings.

@tigermick

I had test to modify config file mount.json to add your setting @oparoz but it doesn't work.
With this setting I can see thumbnails of my picture neither in owncloud app nor in web interface ; without this setting, it works just in web interface.

@tigermick

@oparoz , I just seeing your setting is already in mount.json.
I have this :

"mountOptions": {
                    "encrypt": true,
                    "previews": true,
                    "filesystem_check_changes": 2
                }

Previously, I had add your setting out of mountOptions ... thus your setting is already here and like this, thumbnails display only in web interface.

@oparoz
Contributor
oparoz commented Feb 22, 2016

Thanks @tigermick. This is still on 8.2x, yeah?

@tigermick

my owncloud version is 8.2.2. @oparoz

@tigermick

@oparoz, I had try to delete your setting too ("filesystem_check_changes": 2). Like this, Thumbnails don't display in both (owncloud application and web interface) ...

@oparoz
Contributor
oparoz commented Feb 22, 2016

That sounds very strange. Maybe there is a regression in that part of the code. 9.0 only has an on/off switch for that check.

@tigermick

Hi,

I have updated my owncloud with the recent 9.0 release and I have the same problem ... all works fine in web interface whereas thumbnails won't load in external storage only in owncloud application...

@tigermick

This bug will be fix in the next release 9.0.1please ?

@PVince81
Collaborator

Has anyone been able to reproduce this locally ?

@tigermick

I have always the same problem in OC 9.0 so I can reproduce this issue ...

@PVince81
Collaborator

Works for me on v9.0.0.

Steps:

  1. Setup a SMB external storage under "/smb"
  2. Upload two pictures "test.jpg" and "test.png" into "/smb"
  3. curl -D - -X GET http://admin:admin@localhost/owncloud/index.php/apps/files/api/v1/thumbnail/100/100/smb/test.png -o thumb.png
  4. curl -D - -X GET http://admin:admin@localhost/owncloud/index.php/apps/files/api/v1/thumbnail/100/100/smb/test.jpg -o thumb.jpg
  5. Open both images

Images are both valid and can be opened.

@PVince81
Collaborator

Same result with encryption enabled.

Have you tried moving these specific images to a non-external storage folder and see whether thumbnails work, in case it's these specific images that have issues ?

@tigermick

I have setup a local folder external storage.

I go in owncloud officiel app in my local folder external storage and i open a folder with pictures : i can't see thumbnails and i have this error in owncloud :
OC_Image->fixOrientation() Image is not a JPEG.

I go in web interface on my computer.
I open the same folder than with owncloud app : thumbnails is generated and i can see thumbnails displaying.

If i try with a folder out of external storage all work fine in web interfzce and in owncloud app ...

Maybe i must try to delete my external storage and add again ... ?

@tigermick

I have try to delete my external storage with my local folder and set again now and the issue is not fix ...

@PVince81
Collaborator

Can you try with the curl command ?

% curl -D - -X GET http://admin:admin@localhost/owncloud/index.php/apps/files/api/v1/thumbnail/100/100/path/to/file.jpg -o thumb.jpg

Does this produce the same errors in the logs ?

@PVince81
Collaborator

Which external storage type are you using ? SMB, SFTP ? This is also important

@tigermick

I use the type of external storage : local

@tigermick

Your curl command give me this :

'curl -D - -X GET http://admin:admin@localhost/owncloud/index.php/apps/files/api/v1/thumbnail/100/100/path/to/file.jpg -o thumb.jpg
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0HTTP/1.1 301 Moved Permanently
Date: Thu, 24 Mar 2016 13:18:46 GMT
Server: Apache/2.4.10 (Debian)
Location: https://mydomainname/owncloud/index.php/apps/files/api/v1/thumbnail/100/100/path/to/file.jpg
Content-Length: 383
Content-Type: text/html; charset=iso-8859-1

100 383 100 383 0 0 30166 0 --:--:-- --:--:-- --:--:-- 31916'

@tigermick

And i have no error in log ...

@PVince81
Collaborator

Moved permanently ? That's weird.

Try again with curl but on a file that is not on external storage.

Do they both produce a file thumbnail file ? Or is that one broken ?

@PVince81
Collaborator

Tried again with "Local" external storage, works fine, this is what I get:

  % curl -D - -X GET http://admin:admin@localhost/owncloud/index.php/apps/files/api/v1/thumbnail/100/100/Local/test.jpg -o thumb.jpg                                                                                                 !10418
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0HTTP/1.1 200 OK
Date: Thu, 24 Mar 2016 13:43:41 GMT
Server: Apache/2.4.18 (Linux/SUSE)
X-Powered-By: PHP/5.6.17
Set-Cookie: ockbfur1449k=5ntabihf9g6feo2enuctu749vkkume79lln52qhkogh42hm3g761; path=/owncloud; HttpOnly
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-cache, must-revalidate
Pragma: no-cache
Set-Cookie: oc_sessionPassphrase=OvJlrR7slsAPhiIMIf%2BmF%2BkophUulpw6QfCq7jHgYRFcl%2FjtImji2yvhYoqKs1cONllJcsIz98HIlTp05fVr2XNuI8qy8PMZq7TYfmC0AbREpSoPsIBzOVLvo7Ib9V0%2F; path=/owncloud; httponly
Content-Security-Policy: default-src 'none';script-src 'self' 'unsafe-eval';style-src 'self' 'unsafe-inline';img-src 'self' data: blob:;font-src 'self';connect-src 'self';media-src 'self'
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
X-Frame-Options: Sameorigin
X-Robots-Tag: none
X-Download-Options: noopen
X-Permitted-Cross-Domain-Policies: none
Set-Cookie: ockbfur1449k=t6fn6pknqhmuemu229m9ha8e1uogjgqe22l6l431f2espod2dq20; path=/owncloud; HttpOnly
Content-Disposition: inline; filename=""
Content-Length: 4613
Content-Type: image/png

100  4613  100  4613    0     0  10249      0 --:--:-- --:--:-- --:--:-- 10228
@tigermick

Sorry i haven't modify your url in your command with path of a file ...
Wait i try again your first command ....

@tigermick

I think, i don't understand how to modify your command to adapt with my file ...
admin:admin is for the user admin with password admin ?
when you write ".../thumbnail/100/100/path/to/file.jpg", if my jpeg file is in /media/test/test.jpg, i must modify your command like this : ".../thumbnail/100/100/media/test/test.jpg" ???

@PVince81
Collaborator

@tigermick yes, correct.
If you don't want to embed the password on the CLI, you can also do this:

% curl -D - -u yourusername -X GET http://yourhost/yourowncloud/index.php/apps/files/api/v1/thumbnail/100/100/media/test/test.jpg -o thumb.jpg

It will ask for the password afterwards.

@tigermick

so I have tried with the correct command and it's exactly the same thing ...

% Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0HTTP/1.1 301 Moved Permanently
Date: Thu, 24 Mar 2016 17:26:35 GMT
Server: Apache/2.4.10 (Debian)
Location: https://MyDomain/MyOwncloud/index.php/apps/files/api/v1/thumbnail/100/100/media/Donnees/NetworkHD/Photos/Divers/moi7.jpg
Content-Length: 424
Content-Type: text/html; charset=iso-8859-1

100   424  100   424    0     0  59726      0 --:--:-- --:--:-- --:--:-- 70666
@tigermick

To try with a file than I added in my OC web interface how to do this ?

curl -D - -u yourusername -X GET http://yourhost/yourowncloud/index.php/apps/files/api/v1/thumbnail/100/100/MyFile.jpg -o thumb.jpg
??

I'm sorry for this problem but i don't understand where is the error in my config... all work fine in web interface and not in owncloud application in external storage (type local) only ...

@tigermick

I just have been trying with smb external storage and thumbnails display in owncloud app and OC webinterface.

i think, I am having my problem just with local external storage ... I don't know why ...

@tigermick tigermick changed the title from Owncloud Android App can't see Thumbnails in external storage in 8.2.1 - Server Log shows OC_Image->fixOrientation() Image is not a JPEG. to Owncloud Android App can't see Thumbnails in external storage in 8.2.1- 8.2.2 - 9.0.0 - Server Log shows OC_Image->fixOrientation() Image is not a JPEG. Mar 26, 2016
@PVince81
Collaborator

Not sure, maybe check your .htaccess file and web server config, maybe something is preventing this route to be accessed ?

@tigermick

I'm going to see if i find a problem setting in .htaccess or apache server config, but if there was a problem in my setting, shouldn't thumbnails work in web interface too, no ?

@lgg42
lgg42 commented Mar 31, 2016

Guys,.. I've seen something I guess not tried before (please correct me if
I'm wrong)
I'm using the Android app "Cirrus" (it behaved exactly the same way as the
ownlcloud one, [it's a fork actually] so I decided to ditch the official
one) and like many folks here, I only obtained the icon place holder,
nevertheless, if I opened the image (without downloading it, since it's a
feature of Cirrus) I could get it right, all the images. But I guess it
might just download it to RAM or whatever. BUT, while being in the folder,
I tried downloading a single image. AND, after that,... some thumbnails
were being generated, sometimes all of that folder, sometimes a few. It
works with any folder within local storage.

Could someone try this to and give confirmation?

Some nginx logs..(my OC is served by an Apache reverse proxied by nginx)

For an image in the folder, which had the placeholder icon, this was the
nginx response:

/var/log/nginx/05-owncloud_access-ssl.log:192.168.1.112 - -
[31/Mar/2016:16:47:37 +0200] "GET
/index.php/apps/files/%20api/v1/thumbnail/256/256/fotos/Croacia/Motovun/
IMG_20140918_190600865.jpg?modified=1411059960000&rid=00048400ocaucvhpinp1
HTTP/1.1" *302 *0 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64)
AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.75 Safari/537.36
OPR/36.0.2130.32"

And, after downloading ANOTHER image, this is what I get after trying to
browse the folder

/var/log/nginx/05-owncloud_access-ssl.log:192.168.1.112 - -
[31/Mar/2016:16:48:16 +0200] "GET
/index.php/apps/files/api/v1/thumbnail/256/256/fotos/Croacia/Motovun/
IMG_20140918_190600865.jpg?modified=1411059960000&rid=00048400ocaucvhpinp1
HTTP/1.1" *200 *7960 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64)
AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.75 Safari/537.36
OPR/36.0.2130.32"

And of course,.. I get the correct thumbnail displayed.
Again.. all this using the Cirrus android app.

On Tue, Mar 29, 2016 at 10:25 AM, tigermick notifications@github.com
wrote:

I'm going to see if i find a problem setting in .htaccess or apache server
config, but if there was a problem in my setting, shouldn't thumbnails work
in web interface too, no ?


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

@tigermick

Hi lgg42,

I have tried your thing.
I install cirrus for owncloud on my phone.
I try to go in a folder in my local external storage
No thumbnails are display
I try to open a picture without download it ; it's ok ! I go back to the files list and 3 pictures have success to generate a thumbnail... but not all !

I think, it's the same issue than you.

@oparoz
Contributor
oparoz commented Mar 31, 2016

Again.. all this using the Cirrus android app.

That seems to be a problem specific to the Cirrus app

@tigermick

But @oparoz in official android app, no thumbnails are displayed.
Just in local external storage and just in android app...
In cirrus app, 3 thumbnails are displayed after loading one picture ...

@oparoz
Contributor
oparoz commented Mar 31, 2016

@tigermick - Indeed, but if Cirrus fixed its bugs you could probably have more thumbnails.
The problem is that we don't know how it works and it seems to do things differently.
For external storage thumbnails, try this fix:
#21485 (comment)

@tigermick

@oparoz
I have trying this fix and no change ... thumbnails don't want display
In OC web interface, all work fine in my local external storage ... all thumbnails are generated and displayed ....

@oparoz
Contributor
oparoz commented Mar 31, 2016

Thanks for testing.

I've just done some tests using SMB and I got the same results @PVince81 got, so not sure what is so different with your configurations.

@tigermick

I have try with smb external storage on my server and thumbnails are genereted and displayed in official android app

@oparoz oparoz changed the title from Owncloud Android App can't see Thumbnails in external storage in 8.2.1- 8.2.2 - 9.0.0 - Server Log shows OC_Image->fixOrientation() Image is not a JPEG. to Owncloud Android App can't see Thumbnails of images located on some external storage in 8.2.1- 8.2.2 - 9.0.0 Mar 31, 2016
@oparoz
Contributor
oparoz commented Mar 31, 2016

OK, so which storage fails for you?

@tigermick

Local external storage

@oparoz
Contributor
oparoz commented Mar 31, 2016

The path used by that storage might not be compatible with what is being used here then:
https://github.com/owncloud/core/blob/c5a200c4198de951dabdd3f783ade655b8ea6434/apps/files/controller/apicontroller.php#L82

@tigermick

but why thumbnails is correctly generated and displayed in OC web interface ?

@oparoz
Contributor
oparoz commented Mar 31, 2016

but why thumbnails is correctly generated and displayed in OC web interface ?

Because the GUI does not use this API

But I've just tried by adding /tmp as external storage and had no problem retrieving a thumbnail using the API

@tigermick

ah ok ...
Look at this :
In my owncloud android app, I see that :
screenshot_20160401-003410
And on my computer, I can see that :
capture d ecran de 2016-04-01 00-37-18

After thumbnails are generated on my computer, if i try again with owncloud android app, I refresh folder and I have that :
screenshot_20160401-004126

@lgg42
lgg42 commented Mar 31, 2016

Wow! Really? /tmp does work? Which other mountpoints have you tried?
Did you just copied a bunch of images to /tmp or folder inside /tmp, and
they generated the thumbnail?
May I ask for the owner / permissions / SELinux context of those
filesystems?

Thank you!

I'll make a test with /tmp

On Fri, Apr 1, 2016 at 12:35 AM, Olivier Paroz notifications@github.com
wrote:

but why thumbnails is correctly generated and displayed in OC web
interface ?

Because the GUI does not use this API

But I've just tried by adding /tmp as external storage and had no problem
retrieving a thumbnail using the API


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

El Pollo Eléctrico http://polloelectrico.wordpress.com
Perdido en Madrid http://perdidoenmadrid.tumblr.com

@lgg42
lgg42 commented Mar 31, 2016

Well.. I tried with /tmp and /media/owncloud/tmp and it was a "no" for me.
/media/owncloud is the base directory for owncloud. Checked all the
permissions, ownership and selinux contexts. OC version 8.2.1

On Fri, Apr 1, 2016 at 1:16 AM, Luis Garnica magoseitor@gmail.com wrote:

Wow! Really? /tmp does work? Which other mountpoints have you tried?
Did you just copied a bunch of images to /tmp or folder inside /tmp, and
they generated the thumbnail?
May I ask for the owner / permissions / SELinux context of those
filesystems?

Thank you!

I'll make a test with /tmp

On Fri, Apr 1, 2016 at 12:35 AM, Olivier Paroz notifications@github.com
wrote:

but why thumbnails is correctly generated and displayed in OC web
interface ?

Because the GUI does not use this API

But I've just tried by adding /tmp as external storage and had no problem
retrieving a thumbnail using the API


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

El Pollo Eléctrico http://polloelectrico.wordpress.com
Perdido en Madrid http://perdidoenmadrid.tumblr.com

El Pollo Eléctrico http://polloelectrico.wordpress.com
Perdido en Madrid http://perdidoenmadrid.tumblr.com

@oparoz
Contributor
oparoz commented Apr 1, 2016

I'm using the official VM to test.

0 drwxrwxrwt   6 root root       160 Apr  1 09:17 tmp

Strange if the API cares more about permissions than the endpoint used by files... Maybe you just need to be more patient with the Android app?

@tigermick

I have tried with /tmp too :
drwxrwxrwt 11 root root 20480 avril 1 09:39 tmp
with this file :

-rwxrwxrwx  1 tigermick tigermick 492592 avril  1 09:39 Snapchat-14-11-15.jpg
-rwxrwxrwx  1 tigermick tigermick 667698 avril  1 09:39 Snapchat-7-11-15.jpg

and i have always the same problem :

Debug   core    OC_Image->fixOrientation() Orientation: -1  2016-04-01T07:43:04+00:00
Debug   core    OC_Image->fixOrientation() Image is not a JPEG.     2016-04-01T07:43:04+00:00
Debug   core    Generating preview for "files/Test/Snapchat-14-11-15.jpg" with "OC\Preview\JPEG"    2016-04-01T07:43:04+00:00
DebuDebug   core    OC_Image->fixOrientation() Orientation: -1  2016-04-01T07:43:04+00:00
Debug   core    OC_Image->fixOrientation() Image is not a JPEG.     2016-04-01T07:43:04+00:00
Debug   core    Generating preview for "files/Test/Snapchat-14-11-15.jpg" with "OC\Preview\JPEG"    2016-04-01T07:43:04+00:00
Debug   core    OC_Image->fixOrientation() Orientation: -1  2016-04-01T07:43:22+00:00
Debug   core    OC_Image->fixOrientation() Image is not a JPEG. 2016-04-01T07:43:22+00:00
Debug   core    Generating preview for "files/Test/Snapchat-7-11-15.jpg" with "OC\Preview\JPEG" 2016-04-01T07:43:22+00:00g  core    OC_Image->fixOrientation() Orientation: -1  2016-04-01T07:43:22+00:00
Debug   core    OC_Image->fixOrientation() Image is not a JPEG. 2016-04-01T07:43:22+00:00
Debug   core    Generating preview for "files/Test/Snapchat-7-11-15.jpg" with "OC\Preview\JPEG" 2016-04-01T07:43:22+00:00
@oparoz
Contributor
oparoz commented Apr 1, 2016

Maybe your /tmp is noexec?

@oparoz
Contributor
oparoz commented Apr 1, 2016

OK, so the scenario which doesn't work for me is when I upload directly from the device.
No matter where I upload the file, I first get a 404 returned by webdav.

"app": "webdav",
"message": "Exception: {
    \"Message\":\"HTTP\\\/1.1 404 File with name Croute fromage rat\\u00e9e.jpg could not be located\",\"Exception\":\"Sabre\\\\DAV\\\\Exception\\\\NotFound\",\"Code\":0,\"Trace\":\"#0 \\\/var\\\/www\\\/owncloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/CorePlugin.php(79): OCA\\\\DAV\\\\Connector\\\\Sabre\\\\ObjectTree->getNodeForPath('Croute fromage ...', 0)\\n#1 [internal function]: Sabre\\\\DAV\\\\CorePlugin->httpGet(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#2 \\\/var\\\/www\\\/owncloud\\\/3rdparty\\\/sabre\\\/event\\\/lib\\\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\\n#3 \\\/var\\\/www\\\/owncloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(459): Sabre\\\\Event\\\\EventEmitter->emit('method:GET', Array)\\n#4 \\\/var\\\/www\\\/owncloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/CorePlugin.php(251): Sabre\\\\DAV\\\\Server->invokeMethod(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response), false)\\n#5 [internal function]: Sabre\\\\DAV\\\\CorePlugin->httpHead(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#6 \\\/var\\\/www\\\/owncloud\\\/3rdparty\\\/sabre\\\/event\\\/lib\\\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\\n#7 \\\/var\\\/www\\\/owncloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(459): Sabre\\\\Event\\\\EventEmitter->emit('method:HEAD', Array)\\n#8 \\\/var\\\/www\\\/owncloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(248): Sabre\\\\DAV\\\\Server->invokeMethod(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#9 \\\/var\\\/www\\\/owncloud\\\/apps\\\/dav\\\/appinfo\\\/v1\\\/webdav.php(55): Sabre\\\\DAV\\\\Server->exec()\\n#10 \\\/var\\\/www\\\/owncloud\\\/remote.php(138): require_once('\\\/var\\\/www\\\/ownclo...')\\n#11 {main}\",\"File\":\"\\\/var\\\/www\\\/owncloud\\\/apps\\\/dav\\\/lib\\\/connector\\\/sabre\\\/objecttree.php\",\"Line\":166,\"User\":\"admin\"}",
"level": 0,
"time": "2016-04-01T08:22:36+00:00",
"method": "HEAD",
"url": "\/remote

Maybe @PVince81 knows why and it's probably not a good sign.

But then, if it's uploaded to local storage I get a preview, but on /tmp I get the "not a JPEG" error message in the log

@oparoz
Contributor
oparoz commented Apr 1, 2016

That's what a normal toTmpFile looks like:

\/tempo\/test2\/IMG_1446301218119.jpg -> \/tmp\/test2\/IMG_1446301218119.jpg

That's what happens when submitting the path via the thumbnails API

files\/tempo\/test2\/IMG_1447511168769.jpg -> \/tmp\/o\/test2\/IMG_1447511168769.jpg

So the mountpoint is not properly removed, probably because of the way the preview class is instantiated.

@tigermick

I have tried another thing...
My local external storage is in /media/Donnees/

I have made a symbolic link of this folder in my data owncloud and I have tried to go in my symbolic link from owncloud android app after rescan file with occ.

The result is thumbnails display correctly ...

Maybe the preview process isn't the same one in owncloud and in external storage extension ...

@PVince81, can you confirm this ?

@tigermick

have Nobody find a solution about my problem please ?

@cmonteroluque
Contributor

@davivel can you have a look?

@davivel
Member
davivel commented Apr 15, 2016

I can try, but I wouldn't be very optimistic. From the dialog before I'd guess this is a problem due to different execution paths in the server side for previewing from the web UI and previewing via /index.php/apps/files/api/v1/thumbnail/

@PVince81
Collaborator

So the mountpoint is not properly removed

@oparoz can you clarify what you mean with this ? Why should the mountpoint be removed ?

@oparoz
Contributor
oparoz commented Apr 18, 2016

@oparoz can you clarify what you mean with this ? Why should the mountpoint be removed ?

@PVince81 - From the path.

This path \/tmp\/o\/test2\/IMG_1447511168769.jpg should be \/tmp\/test2\/IMG_1447511168769.jpg like when not using the thumbnail API.

@oparoz
Contributor
oparoz commented Apr 18, 2016

@PVince81 - Some normalisation is failing and instead of removing tempo/, only temp is removed

@PVince81
Collaborator

Ah, got it. Ok, so if you say this is reproducible when using "/tmp" as local storage then it should be possible to fix it.

@oparoz
Contributor
oparoz commented Apr 18, 2016

using "/tmp" as local storage

local storage via the files_external app, yes.

@PVince81
Collaborator

@georgehrke can you have a look ?

@georgehrke georgehrke was assigned by PVince81 Apr 19, 2016
@georgehrke
Contributor

Yes, I'll take a look when I'm back from vacation next week

@tigermick

It's working fine with this fix ! Thank you very much !!!

@tigermick tigermick closed this May 1, 2016
@lgg42
lgg42 commented May 5, 2016

Same over here! thumbnails working on external storage in android app with
this fix. Thank you!!!

On Sun, May 1, 2016 at 10:05 PM, tigermick notifications@github.com wrote:

It's working fine with this fix ! Thank you very much !!!


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

El Pollo Eléctrico http://polloelectrico.wordpress.com
Perdido en Madrid http://perdidoenmadrid.tumblr.com

@oparoz
Contributor
oparoz commented May 5, 2016

Re-opening as no fix has been merged yet.

@oparoz oparoz reopened this May 5, 2016
@PVince81
Collaborator
PVince81 commented May 6, 2016

The "fix" is too generic and is likely breaking a lot of other things. It needs to be adjusted to only affect thumbnail creation.

@PVince81
Collaborator
PVince81 commented Jun 2, 2016

@tigermick this is fixed, finally. Will be in the next release.

@PVince81 PVince81 closed this Jun 2, 2016
@davivel
Member
davivel commented Jun 7, 2016

Great to know, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment