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

Resizing browser window or rotating mobile device should result in corrected image size being displayed. #142

Closed
setnes opened this issue May 16, 2015 · 10 comments

Comments

@setnes
Copy link
Contributor

setnes commented May 16, 2015

In the gallery slideshow, if a user changes the browser window size, the image should be corrected to fit the new window size. This is very evident when using a mobile device to view photos. It's normal to assume a user will try rotating a phone to match portrait or landscape images and expect the image to fill the screen correctly.

This might mean we should request the scaled image based on the longest edge of the screen for both X and Y and then always resize to fit the browser. Otherwise the image might need to be re-downloaded (bad?). I'm not sure.

Again, PhotoSwipe does this correctly, but there might be other ways to accomplish this.

http://photoswipe.com/

@oparoz
Copy link
Contributor

oparoz commented May 16, 2015

I have an idea on how to quickly solve this...

@oparoz oparoz self-assigned this May 16, 2015
@oparoz
Copy link
Contributor

oparoz commented May 16, 2015

After having toyed with it a bit it seems it's more complicated than I anticipated, so I will see if someone else wants to give it a go.

Photoswipe could be a better alternative to Bigshot since it supports zooming, swiping and resizing, but it's too early to tell and we would lose the proper zooming that Bigshot offers (not implemented yet).

@oparoz oparoz removed their assignment May 16, 2015
@oparoz
Copy link
Contributor

oparoz commented May 16, 2015

I've had a look at Photoswipe's API and one reason it works well is because it needs to be given the dimensions of the images at initialisation time.
http://photoswipe.com/documentation/faq.html#image-size

Unfortunately ownCloud doesn't know anything about the images it's sending back, so there is no immediate solution, but starting from 8.1, oC will have a max size preview from which all subsequent previews are generated and we might be able to hack something together to calculate the image size based on that information and the screen size.

  1. Get thumbnail
  2. Looks at max preview
  3. Send back thumbnail along with size meta data
  4. Adjust dimensions to make them fit on screen
  5. Ask for preview of calculated dimensions

Regarding the change of browser window size, past a certain point, there is no way around loading a new image. The core preview system should be upgrade one day to offer S, M and L previews and that would make things easier.

@oparoz
Copy link
Contributor

oparoz commented May 17, 2015

The above approach can't be taken for 2 reasons:

  1. There may not be a preview yet, like on the Files app, with freshly uploaded images
  2. We don't always have thumbnails before launching the slideshow

So we'll have to wait for a version of oC which supports meta data and automatic thumbnail generation on upload.

@setnes
Copy link
Contributor Author

setnes commented May 18, 2015

I really appreciate the time spent looking into this issue and #141. It sounds like both would be helped by some image meta data storage in the future. Thanks again.

@oparoz
Copy link
Contributor

oparoz commented Jun 22, 2015

We need some people to test this on their mobile
@deMattin @libasys @jancborchardt @georgehrke @jospoortvliet

Just start the slideshow with a wide or tall picture and rotate your device. The image should always touch 2 sides of the phone.

@jancborchardt
Copy link
Member

@oparoz to test what exactly – is there a pull request? :)

@oparoz
Copy link
Contributor

oparoz commented Jun 23, 2015

There was :)

For testing, you just need to use master or dev, depending on your setup and load some pictures in the slideshow to see if they adapt to the screen size when rotating the device.

On the current release (11), they don't, so if you're in portrait mode and go landscape, you still get the small picture.

@jospoortvliet
Copy link

It seems to work all fine here.

@oparoz
Copy link
Contributor

oparoz commented Jun 24, 2015

Thanks! :)

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

4 participants