Skip to content

Thumbnails from server - #635

Closed
tobiasKaminsky wants to merge 5 commits into
owncloud:thumbnails_for_downloaded_imagesfrom
tobiasKaminsky:thumbnails_from_server
Closed

tobiasKaminsky wants to merge 5 commits into
owncloud:thumbnails_for_downloaded_imagesfrom
tobiasKaminsky:thumbnails_from_server

Conversation

@tobiasKaminsky

Copy link
Copy Markdown
Contributor

Preview thumbnail from server for images that are not downloaded.
This uses newly created rest api for thumbnails (owncloud/core#11009).

@tobiasKaminsky

Copy link
Copy Markdown
Contributor Author

@davivel What do you think?
I had (once again) to create an OwnCloudClient with OwnCloudAccount, but this time no second authorization is needed.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should think in refactoring a bit this to add a "Thumbnail" resource in owncloud-library, but maybe we should merge this first.

On the while, some low level details:

  • Uri.encode(file.getRemotePath(), "/") does the same job than URLEncoder.encode(file.getRemotePath(), "UTF-8").replaceAll("%2F", "/"), but shorter.
  • Instead of hardcoding 100 x 100, define constants like THUMB_WIDTH, THUMB_HEIGHT ; or even better, we can try to request the lowest resolution appropiate to get 32dp thumbnails, depending on the screen density.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is already a conversion dp-->px, so I am using this.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent!

@davivel

davivel commented Oct 17, 2014

Copy link
Copy Markdown
Contributor

Reviewed.

- Thumbnail size is set to 32dp
@davivel

davivel commented Oct 20, 2014

Copy link
Copy Markdown
Contributor

About the use of OwnCloudClient, it's fine.

The refactoring we applied for the OwnCloudClient creation needs some improvements to be used out of the OperationService (all those possible exceptions when creating an OwnCloudAccount are really ugly), but I think it's fine for the moment. This is not a good moment for more refactoring on it.

@tobiasKaminsky

Copy link
Copy Markdown
Contributor Author

The needed changes of core (REST route) will be in master tomorrow.
I think we have to check for a server version to even try to use the route, or can we just assume that all server are up to date?
Otherwise the app will try to download the thumbnail for each file every time and forever...

@davivel

davivel commented Oct 21, 2014

Copy link
Copy Markdown
Contributor

You are right, I forgot that point. Let me think a bit about it.

@davivel

davivel commented Oct 28, 2014

Copy link
Copy Markdown
Contributor

@jabarros fulfilled the server check in other branch; we are going to validate it right now.

This is replaced by #687

@davivel davivel closed this Oct 28, 2014
@tobiasKaminsky
tobiasKaminsky deleted the thumbnails_from_server branch December 13, 2015 11:20
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

Successfully merging this pull request may close these issues.

2 participants