OC8, galleryplus and previews

Ask all your questions regarding OC 8.0 and 8.1 Please read the Support Forum Rules
Forum rules
The forums were migrated over to https://central.owncloud.org which is based on the forum software Discourse. The forums here is put into read-only mode starting from today.

More background information about this move and the reasoning behind it is available in this blogpost:

https://daniel.molkentin.net/2016/07/20 ... d-central/
mehturt
Beginner
Posts: 31
Joined: Wed May 23, 2012 11:58 pm
ownCloud version: 8.1.1
Webserver: Apache
Database: SQLite
OS: Linux
PHP version: 5.6.13
Location: EU

OC8, galleryplus and previews

Postby mehturt » Tue Sep 22, 2015 5:33 pm

I want to understand how previews and thumbnails work in OC8.
It seems to me the previews is a feature of OC core and gallery plus is just using it.
So I don't have any previews configuration in my config.php so defaults are used. Here are my observations.
Max preview size is set to 2048, so upon viewing pictures in a gallery, all images are scaled to 2048 and saved in "thumbnails" folder. So let's say my original pictures are 3000 by something pixels, I'll have them duplicated in thumbnails, scaled down to 2048. Now when viewing particular picture, for some reason the original picture is not served, instead another copy is created, scaled to 2000 by something. So now I have my original picture (3000 by something), thumbnail (2048 by something) and another thumbnail (2000 by something). What is the idea behind this?
I would expect thumbnails of certain size (e.g. 200x200) to be used when viewing a directory of pictures and the full size picture shown when particular picture is selected. So the thumbnails 2048x and 2000x seem redundant to me.
I tried to configure preview_max_x and preview_max_y but it seems to affect the actual size of picture served when viewing the particular picture (not just the preview of pictures in a folder).

RealRancor
ownCloud master
Posts: 17381
Joined: Sat May 26, 2012 3:00 pm
ownCloud version: 9.0.2
Webserver: nginx
Database: MySQL
OS: Linux
PHP version: 7.0.x

Re: OC8, galleryplus and previews

Postby RealRancor » Tue Sep 22, 2015 6:22 pm

Hi,

i suggest to ask this question at the developers mailinglist:

https://mailman.owncloud.org/mailman/listinfo/devel

where you can reach the people having the knowledge about such oC internals and know the reasons of this behaviour.
*gone*

mehturt
Beginner
Posts: 31
Joined: Wed May 23, 2012 11:58 pm
ownCloud version: 8.1.1
Webserver: Apache
Database: SQLite
OS: Linux
PHP version: 5.6.13
Location: EU

Re: OC8, galleryplus and previews

Postby mehturt » Tue Sep 22, 2015 8:20 pm

Thank you, question sent.

User avatar
interfaSys
Starter
Posts: 82
Joined: Mon Dec 03, 2012 9:53 pm
ownCloud version: 8.1.1
Webserver: Apache
Database: MySQL
PHP version: 5.5
Location: Switzerland and UK
Contact:

Re: OC8, galleryplus and previews

Postby interfaSys » Thu Sep 24, 2015 1:56 am

so upon viewing pictures in a gallery, all images are scaled to 2048 and saved in "thumbnails" folder


Almost. This is done the first time a preview is asked for. It doesn't matter which app makes the call.

for some reason the original picture is not served


For performance reason. You may have 3000x2000 JPEGs, but some people have 10000x6000 pictures and we want to make sure those can be viewed quickly online, so we only resize the biggest preview we have instead of having to resize and convert the original.

The benefits are much larger when working with Photoshop, Illustrator, Postcript or Raw files. These can weigh several tens of megabytes, even over a 100. By keeping a large preview in the thumbnails folder, ownCloud can quickly generate more thumbnails, of different sizes.

I would expect [...]the full size picture shown when particular picture is selected


Imagine you're on your mobile, with a 720p screen. Do you really want to waste bandwidth and time to download a 5000x3000 preview? Instead the 2048 pixels wide thumbnail will be resized to 1280 pixels and sent to your phone. The next person requesting a thumbnail with that screen dimension will get the cached copy.
If you want to store the original on your phone, you can always click the download button.

I would expect thumbnails of certain size (e.g. 200x200) to be used when viewing a directory of pictures


That's happening as well. 36px previews for the thumbnails 400x400 previews for the Gallery albums, 400x200 thumbnails for the photowall.

The plan is to, at some point, create categories. 50, 512, 1024, 2048 per example and to only store and send those sizes, letting the client resize the image, but nobody has stepped in to implement this yet.

I tried to configure preview_max_x and preview_max_y but it seems to affect the actual size of picture served when viewing the particular picture (not just the preview of pictures in a folder).


Those settings only affect the generation of the first, large preview. All subsequent previews will be smaller thumbnails of that.
The best thing to do is to delete all your thumbnails if you change those parameters.
Cheers,

Olivier
Consultant @ interfaSys
Maintainer of Gallery+ https://apps.owncloud.com/content/show.php?content=169116

mehturt
Beginner
Posts: 31
Joined: Wed May 23, 2012 11:58 pm
ownCloud version: 8.1.1
Webserver: Apache
Database: SQLite
OS: Linux
PHP version: 5.6.13
Location: EU

Re: OC8, galleryplus and previews

Postby mehturt » Thu Sep 24, 2015 8:17 am

Thank you for detailed explanation. I gathered it works like this reading the github issues around previews. Still I think generating previews of various sizes and storing them locally as well is a waste of resources. Also, creating a local preview of size 2000 when preview of size 2048 already exists is a waste as well.
I agree that creating preview of size 2000 when the original picture is of size 10000 may be a good idea, but if the original picture is of size 3000? I'm not so sure. But even if it was, I think that storing multiple size previews locally, depending on the size of requestor's screen is not good. Is it possible to generate just the configured size preview and the other size images will be just served upon request, without storing them locally?

User avatar
interfaSys
Starter
Posts: 82
Joined: Mon Dec 03, 2012 9:53 pm
ownCloud version: 8.1.1
Webserver: Apache
Database: MySQL
PHP version: 5.5
Location: Switzerland and UK
Contact:

Re: OC8, galleryplus and previews

Postby interfaSys » Thu Sep 24, 2015 9:06 am

I agree that creating preview of size 2000 when the original picture is of size 10000 may be a good idea, but if the original picture is of size 3000?


The algorithm could be made smarter. Someone just needs to write it...


Is it possible to generate just the configured size preview and the other size images will be just served upon request, without storing them locally?


That's a huge waste of resources because all images will need to be resized every time, for every users opening the folder. Caching them does make a difference, especially with external storage.
Cheers,

Olivier
Consultant @ interfaSys
Maintainer of Gallery+ https://apps.owncloud.com/content/show.php?content=169116

mehturt
Beginner
Posts: 31
Joined: Wed May 23, 2012 11:58 pm
ownCloud version: 8.1.1
Webserver: Apache
Database: SQLite
OS: Linux
PHP version: 5.6.13
Location: EU

Re: OC8, galleryplus and previews

Postby mehturt » Thu Sep 24, 2015 9:52 am

interfaSys wrote:
Is it possible to generate just the configured size preview and the other size images will be just served upon request, without storing them locally?


That's a huge waste of resources because all images will need to be resized every time, for every users opening the folder. Caching them does make a difference, especially with external storage.

Why resize them in the first place when you already have the 2000px preview. Also, the thumbnails are separate per user even if different users view one shared album, right? Also, when viewing photos via e.g. Android OC app, the images are downloaded (thus cached) locally when you view them. Also, when using the browser, the images are cached in the browser as well.

User avatar
interfaSys
Starter
Posts: 82
Joined: Mon Dec 03, 2012 9:53 pm
ownCloud version: 8.1.1
Webserver: Apache
Database: MySQL
PHP version: 5.5
Location: Switzerland and UK
Contact:

Re: OC8, galleryplus and previews

Postby interfaSys » Thu Sep 24, 2015 9:59 am

Why resize them in the first place when you already have the 2000px preview.


To save bandwidth, mainly. And you have the max_preview set to 2048, but someone may want it set at 4k, because we're all going to use 4K screens soon and it will make even more difference in terms of bandwidth.

Also, the thumbnails are separate per user even if different users view one shared album, right?


Correct. Some solutions have been talked about, but nothing has been implemented yet.

Also, when viewing photos via e.g. Android OC app, the images are downloaded (thus cached) locally when you view them. Also, when using the browser, the images are cached in the browser as well.


Yes, but they're not cached for visitors of public links.
Cheers,

Olivier
Consultant @ interfaSys
Maintainer of Gallery+ https://apps.owncloud.com/content/show.php?content=169116

mehturt
Beginner
Posts: 31
Joined: Wed May 23, 2012 11:58 pm
ownCloud version: 8.1.1
Webserver: Apache
Database: SQLite
OS: Linux
PHP version: 5.6.13
Location: EU

Re: OC8, galleryplus and previews

Postby mehturt » Thu Sep 24, 2015 10:03 am

Regarding the bandwidth - I see over time my bandwidth grows faster than my OC hardware :)
Thanks for your time.

User avatar
interfaSys
Starter
Posts: 82
Joined: Mon Dec 03, 2012 9:53 pm
ownCloud version: 8.1.1
Webserver: Apache
Database: MySQL
PHP version: 5.5
Location: Switzerland and UK
Contact:

Re: OC8, galleryplus and previews

Postby interfaSys » Thu Sep 24, 2015 10:10 am

The problem is trying to find a solution which works for most.
100 pictures x 300k overhead = 30MB. Some people just don't want this to happen while browsing on their mobile phone.

I've just deleted 3.7GB of thumbnails from the Gallery+ demo site... That's insane for just a few pictures. A fresh set of thumbnails is less than a 100MB.

So, this can all be improved. We "just" need people to design the specs and people to implement a better solution.
Cheers,

Olivier
Consultant @ interfaSys
Maintainer of Gallery+ https://apps.owncloud.com/content/show.php?content=169116


  • Similar Topics
    Replies
    Views
    Last post

Return to “ownCloud Server 8.0 and 8.1”

Who is online

Users browsing this forum: No registered users and 4 guests