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

Cache image dimensions #7881

Closed
jbtbnl opened this issue Mar 25, 2014 · 6 comments
Closed

Cache image dimensions #7881

jbtbnl opened this issue Mar 25, 2014 · 6 comments

Comments

@jbtbnl
Copy link
Contributor

jbtbnl commented Mar 25, 2014

Feature request: cache the dimensions of all images.

I'm currently working on a seamless display for the Gallery app (owncloud/gallery#17). The current situation is that pictures get downloaded and the dimensions are calculated at the client side. After enough pictures for an entire row are downloaded the images of that row are justified and then displayed. Therefore it takes a while before the first row of images is shown, forcing the user to wait longer then necessary.

The above can be fixed by caching the dimensions of all images. The dimensions can be sent to the client before actually downloading the images, enabling the client to calculate the justification beforehand and display the image instantly on arrival at the right location.

@PVince81
Copy link
Contributor

Idea:

  1. Have an ajax endpoint to retrieve the image URLs, I think it probably already exists
  2. That ajax endpoint reads the list of images from the current album and the possibly cached dimensions. If dimensions are not available, use exif function or something to read them and cache them.
  3. Return the image list as JSON array, including metadata.

For cache the image metadata the gallery app could provide its own database table.

I'm not sure whether it's a good idea to introduce such metadata layer directly in core.

@jbtbnl
Copy link
Contributor Author

jbtbnl commented Mar 26, 2014

@PVince81 yes, that's exactly what I have in mind. The reason why I request this feature in core is that OC_Image already has functions for the image height and width and it seems logical to implement caching at the image object level so that other apps might benefit from the speed improvement as well.

@DeepDiver1975
Copy link
Member

In addition we should keep in mind that we have thumbnail generation in core.
From my understanding gallery should reuse that instead of implementing it's own.

@jbtbnl
Copy link
Contributor Author

jbtbnl commented Mar 26, 2014

Any idea what the purpose of the table oc_pictures_images_cache is ? It has the columns height and width but is empty in my database...

@oparoz
Copy link
Contributor

oparoz commented Jan 22, 2015

Seems this is no longer necessary as thumbnails are now displayed quickly in the gallery. Can we close this?

@oparoz
Copy link
Contributor

oparoz commented Jul 2, 2015

Now that we generate the max preview, it should be easy to add its dimensions to the file cache at generation time.

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

7 participants