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

Show thumbnails for pictures #317

Closed
mbiebl opened this issue Nov 29, 2013 · 56 comments
Closed

Show thumbnails for pictures #317

mbiebl opened this issue Nov 29, 2013 · 56 comments

Comments

@mbiebl
Copy link

mbiebl commented Nov 29, 2013

In folder view, it would be nice if the android apps shows thumbnails for pictures much like it is done in OC 6.0 now.

@jancborchardt
Copy link
Member

Yes, that would be really useful to know which picture is which!

@davivel
Copy link
Contributor

davivel commented Mar 12, 2014

Cool idea.

  • Do we have a thumbnails API in the server side?
  • Should we generate local thumbnail for already downloaded images?

@jancborchardt
Copy link
Member

@DeepDiver1975 @georgehrke do we have a thumbnails API ^?

Should we generate thumbnails for already downloaded images – good question. Is it performant, and does it make sense when we have a thumbnails API?

@DeepDiver1975
Copy link
Member

We have a thumbnail api aka url to be called.
But before integrating it into the clients I'd prefer to have a more detailed look. E.g. we have different urls for public sharing, versions etc.

in addition we need to adjust the fall back behavior. There is no need to return the mimeicons - the clients have device specific mimeicons which you want to use.

@MTRichards prio? Oc7?

@davivel
Copy link
Contributor

davivel commented Mar 13, 2014

About generating locally, the question of performance should be tested, can't be guessed in advance. Anyway, we can expect a great variation depending of the device and the resolution of the downloaded images.

The only reason to avoid using the thumbnail API would be lower the user of network.

@DeepDiver1975
Copy link
Member

Hint: we have a customer with his own mobile apps and they consume server side generated thumnbails

@jancborchardt
Copy link
Member

@rperezb @MTRichards do we have this on the roadmap? Currently the app is basically useless for a folder with pictures. (Same goes for the iOS app.)

Also see #239 (gallery view)

@joeplus
Copy link

joeplus commented Jun 4, 2014

Just joining the conversation but apparently there are a lot of people interested in this (see #239, #429 and others for iOS) and others issues that have been closed already. I just wanted to know if that feature has been put on a roadmap or assigned to somebody? It would be a great asset for owncloud also in comparison to NAS manufacturers who have this feature in there apps already or implementing it right now. Would be good to even the playground with dropbox and others as well.

@davivel
Copy link
Contributor

davivel commented Jun 5, 2014

We don't have an estimation to release this yet.

@tobiasKaminsky
Copy link
Contributor

Hello,
I am interested in taking over this part. Or is someone else already programming it?

My first approach would be to add the thumbnail in the file list:
Dynamically load the preview for the files if they are visible

As far as I have read there should be a thumbnail API in oC6. But I have not found any documentation how to use/access it. Can someone point it to me?

Lader adding a more "flickr" like system.
Maybe we/I should collect all ideas in the same place so we can discuss the further steps and wishes before programming it. (Related to #239 #429)

@davivel
Copy link
Contributor

davivel commented Aug 4, 2014

HI, @tobiasKaminsky.

Feel free to go for it, nobody is working in this feature right now.

I'd recommend you go step by step. Collection all the ideas in a single point may easily finish in implementing nothing.

About the thumbnail API... I do not know what is its state now. @DeepDiver1975 , was it finally included in OC7?

@DeepDiver1975
Copy link
Member

Generally speaking: thumbnailing has been added with OC6 - but there is still no public http api to be used by the mobile clients.

In addition: with respect to the processing power of modern mobile devices: Does it really make sense to load the thumbnails from the server?

@jancborchardt
Copy link
Member

Yeah, I would also think it makes more sense to compute the thumbnails on the client.

@joeplus
Copy link

joeplus commented Aug 4, 2014

There is only one slight problem in my opinion with generating the thumbs on the device, bandwith and data traffic, if you are not on a wifi network. Having 5mb pictures, e.g. for photographers with high res jpgs, will Iead to very slow load times and an excessive use of data traffic I guess.

@davivel
Copy link
Contributor

davivel commented Aug 4, 2014

Generate thumbnails in the device is a good idea for pictures that are already downloaded. But the mobile apps do not download the content of files directly. As @joeplus notices, there is data traffic cost to take into account.

@jancborchardt
Copy link
Member

True. So maybe we can start by generating thumbnails on the device for those images which are already downloaded? Would already be a big improvement.

@tobiasKaminsky
Copy link
Contributor

Then I will implement this:
Images on the devices: Thumbnails generated directly on the phone
Images not yet downloaded: Public thumbnail API is necessary.

Regarding API: https://play.google.com/store/apps/details?id=md.steuer.mobile.owncloud_gallery.free This app seems to use the preview function. Although it does not work in my case...

@apramhaas
Copy link

I would also suggest to generate the thumbnails on the server side.
Advantages:

  • Less data traffic on the mobile device
  • Faster picture download
  • Less computing time on the mobile device -> increased battery lifetime
  • Typically the server has more cpu power than the mobile device for thumbnail generation (depends on users)

Furthermore I will suggest to automatically generate a thumbnail on the server whenever a picture in a supported format is uploaded to the repository and store it with the original picture (maybe 75x75 and 800x600)

  • Thumbnails only consume a few kB of storage space
  • The thumbnails are already available when you need it -> reduce loading time when you browse through a directory with many pictures.
  • Eliminate the server as bottleneck if there is a small appliance with little computing power in use (e.g. Rasbperry Pi)
  • Better scalability if you host many users on the same machine

@jancborchardt
Copy link
Member

@unclejamal3000 – as @DeepDiver1975 said: The functionality is in place, but the API is missing so far. So we have to start with generating thumbnails of the files which are available on the device.

@joeplus
Copy link

joeplus commented Aug 4, 2014

@tobiasKaminsky: I was about to suggest that app as well. It worked for me with the owncloud demo server. It would be a great add-on and I am willing to help if you give me some pointers on what to do 😊

@tobiasKaminsky
Copy link
Contributor

Ok.
So far I have added the local thumbnail generation for the list view. The thumbnails are therefore very small.
Now I am trying to add something like this:
#239 (comment)
Currently it is looking likes this: https://owncloud.tobiaskaminsky.de/public.php?service=files&t=a647367bc07b221bec65f4879662cf37
The "flower" images are files which have not been downloaded so there is no thumbnail available.

What do you suggest how the change between the "file detail" and the "image" view should be:

  • manually: choosing it on top (like in file browsers on the pc)
  • decide by threshold: e.g. > 50% of files are images --> image-view?
  • store the decision in a database: First the user will see the default view and can change it per folder to the image view

Also it should be discussed how other file types should be displayed and if it is necessary to put all features (like selecting, etc.) in this view...

@joeplus
Copy link

joeplus commented Aug 5, 2014

Looks good already! I think for now it would be good and easy to let the user choose manually. For the future and please don't shoot me, I think it would be good to look at the possibility to separate file and photo views. For example having a slider menu with different list items like in the OC web-interface, tabs or even different apps.

Regarding the other filetypes, once the server side thumbnails are in place it would be possible to show a thumbnail for them as well. As for now I think it would make sense to have a placeholder with the same dimensions as the thumbnails saying "Thumbnail not available for this filetype" or showing it through an icon. What do you think?

@jancborchardt
Copy link
Member

@tobiasKaminsky ohh, that looks cool! One improvement would be to show more images in a row, say 3 or 4 (similar to the iOS photo screenshot in the issue you linked). Otherwise you need to scroll a lot in this view.

@joeplus for ownCloud we aim to do things with good design and as little settings as possible, only where needed.

Hence it would make most sense to automatically use this thumbnail view for folders where there are only images (or, say 90% of the elements are images). So @tobiasKaminsky the threshold decision you mention is best – we just have to decide on (and then maybe refine) the threshold.

@jancborchardt
Copy link
Member

@tobiasKaminsky you’re very welcome in our #owncloud-android IRC channel by the way! In case you have any dev questions, someone who can help you is probably there as well.

@davivel
Copy link
Contributor

davivel commented Aug 6, 2014

@tobiasKaminsky , did you already generate thumbnails for the list view? Why not merging that yet, instead of waiting for something more complex? Small PRs are easier to test and review than big ones.

About the grid layout - I would really like we calrifiy about how to integrate that in the app flow. If I understood well, you mean replacing the regular list view with a grid of images in case that most of the files in a folder are images. That could make really easy to "lose the track" of files that are not images in those folders. Even showing the file icons for those files, we will not see their names.

What I really miss now in the app is the lateral sliding panel. An option there to swap between list and grid view seems better IMHO.

@jancborchardt
Copy link
Member

@tobiasKaminsky right – a good first step would be to just add thumbnails to the normal list view. Just like it is in the web interface.

@tobiasKaminsky
Copy link
Contributor

I have created a pull request:
#583
(Unfortunely the commit consists of 4 commits, as I had to revert my changes from switching to the gridView).

@ddijak
Copy link

ddijak commented Aug 8, 2014

Does your api use the same thumbnails as preview.png or does it generate new ones?

@tobiasKaminsky
Copy link
Contributor

It is using \OC\Preview().
I do not know what this does internally...
(But the api is more or less just a first step or a proof of concept to see if the android app can get thumbnails. The next steps will be to refine it and maybe use existing structures.)
If you can point me where this preview.png is generating its thumbnails I can adjust my Api to use these preview thumbnails.

@ddijak
Copy link

ddijak commented Aug 8, 2014

I have them in /owncloud-data/user/thumbnails. I have used preview.png link as I pasted above to get images from server. I used basic authorization (username and password) and started loading images with AsyncTask. I does load images but there are few problems i have to debug. The problem is i make a connection and authorization for each image I want to download. That needs to be fixed.

@tobiasKaminsky
Copy link
Contributor

Therefore I use client.executeMethod(new GetMethod(url...)
Then it uses the SSL system which is already there, I guess.
But, as you said, I also have to create a new connection everytime...

Is your authorization working with https?

@tobiasKaminsky
Copy link
Contributor

@Skymania: My API is currently not working any longer after my upgrade to OC7.
Maybe you can give me your code snippet so I can integrate the download part?

@tobiasKaminsky
Copy link
Contributor

#586
I have to create a pull request for my changes on the server, so this cannot work alone...
(But if @Skymania helps me with the preview.png it will work without changes to the server).

@tobiasKaminsky
Copy link
Contributor

Pull request for route for thumbnail generation is now online.
owncloud/core#10308

@tobiasKaminsky
Copy link
Contributor

In my route i am using OC\Preview which seems to be the same as preview.png uses.
At least in OC\Preview there is something said about /data/user/thumbnails/pathhash/x-y.png structure.
So I guess we can use this route and do not have to use preview.png...

@tobiasKaminsky
Copy link
Contributor

In order to keep things clearer I have summarized the ideas about the gallery view in #239

@ddijak
Copy link

ddijak commented Aug 9, 2014

Great job tobias. Im currenty afk so i'll have a look when im home.

@davivel
Copy link
Contributor

davivel commented Aug 12, 2014

@tobiasKaminsky , could you explain a bit more about the "new external API"? Are you accessing the thumbnails in the server side through a non-standard entry point, then? What will be the behaviour of the app with a regular ownCloud server?

@tobiasKaminsky
Copy link
Contributor

The OCS route system is used on the server side: /ocs/v1.php/thumbnail
This allows to get thumbnails with authorization. The thumbnails are generated and cached on the server (this is done in \OC\Preview).
If the server does not have the route, e.g. it is an old installation the download will fail which results in a default thumbnail. (Of course only for images that have not been downloaded).

@tobiasKaminsky
Copy link
Contributor

@davivel owncloud/core#11009 is the PullRequest for the external API.

@tobiasKaminsky
Copy link
Contributor

The external API is now included in master-branch of core.

@davivel
Copy link
Contributor

davivel commented Sep 17, 2014

@tobiasKaminsky , you are making it !!! 👍 👍 👍

For working in the access to remote thumbnails I suggest to create a new branch from thumbnails_for_downloaded_images . But please, don't add new work directly on it; now it's in QA process and should be blocked, unless bugs are reported on it We would like to ship the feature in its current state for the next release.

@tobiasKaminsky
Copy link
Contributor

@davivel
#635 is an initial try to download thumbnails from server.
I had (once again) to create an OwnCloudClient with OwnCloudAccount, but this time no second authorization is needed.
I think we can discuss this on the new pull request.

@davivel
Copy link
Contributor

davivel commented Nov 5, 2014

Hey, people.

Thanks to @tobiasKaminsky , we have thumbnails for downloaded images now, and we'll have remote thumbnails starting with OC8.

Great!

(Now merged into 'develop', available from next release, probable 1.6.2).

@davivel davivel closed this as completed Nov 5, 2014
@kugel-
Copy link

kugel- commented Jul 9, 2015

Is there anything I need to to enable the thumbnails? I do have OC8.1 and the latest client release

@tobiasKaminsky
Copy link
Contributor

@kugel- There is no need to activate anything - normally.
Do you see previews in the web interface?

Edit: it is better to leave this closed and please open a new issue.

@kugel-
Copy link

kugel- commented Jul 10, 2015

Am 10. Juli 2015 18:18:57 MESZ, schrieb tobiasKaminsky notifications@github.com:

@kugel- There is no need to activate anything - normally.
Do you see previews in the web interface?


Reply to this email directly or view it on GitHub:
#317 (comment)

Yes, but not in the Android client (v1.7.1)

@tobiasKaminsky
Copy link
Contributor

Ah :/
Edit was slower than your email system ;)
Can you please open a new issue to keep this one clean ;)

Can you try it with the demo account?
demo.owncloud.org
test / test

@kugel-
Copy link

kugel- commented Jul 10, 2015

Am 10. Juli 2015 18:28:12 MESZ, schrieb tobiasKaminsky notifications@github.com:

Ah :/
Edit was slower than your email system ;)
Can you please open a new issue to keep this one clean ;)

Can you try it with the demo account?
demo.owncloud.org
test / test


Reply to this email directly or view it on GitHub:
#317 (comment)

Okay, I'll take it back, I do have thumbnails now. It seems my server decided to delete it's thumbnails during the upgrade, and regeneration takes a while (the server is slow, a banana pi board)

@tobiasKaminsky
Copy link
Contributor

Great to hear :)

@jesmrec jesmrec added File list and removed Image labels Mar 27, 2023
hannesa2 pushed a commit that referenced this issue Oct 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants