Creating thumbnails every time?

2muchspam

Joined: 2003-04-10
Posts: 12
Posted: Mon, 2003-05-05 19:37

Greetings!
First off, kudos on this GREAT piece of software!
I've been playing with G2 for a while, and my only complaint is that it seems to create the thumbnails every time that I go to an album. Is this going to be how G2 does it rather than creating and keeping the thumbnail? Can there be an option to store thumbs?
Thanks!

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Tue, 2003-05-06 04:30

Can you explain what leads you to believe that it's creating the thumbnails every time?

By design, G2 creates the thumbnail/resize once and caches it. The cached thumbnail/resize is deleted and recreated it the source image changes, but not otherwise.

 
2muchspam

Joined: 2003-04-10
Posts: 12
Posted: Tue, 2003-05-06 15:52
Quote:
Can you explain what leads you to believe that it's creating the thumbnails every time?

I don't see any new files being created, and once in an album it takes about a second for EACH thumb to show up.
Could I have a mis-configuration? What other information could I give you?
FYI:
I've tried this on two systems with identical results. One is RedHat 8.0/Apache 2.x. The other is a Win2k Server with Apache 2.x as well. Both systems use ImageMagick.

Many thanks for your time!

 
jlhughes

Joined: 2002-06-05
Posts: 81
Posted: Tue, 2003-05-06 18:44

I get similar results.

When displaying the contents of an album it takes a second for each thumb image to load.

The first time opening an album after uploading images, the placeholders for the thumbnail images are not pre-sized. Subsequent visits to the album have the placeholders correctly sized.

In all cases, however, the thumbs take about a second to load, even when you are returning to an album you just viewed.

All of G1 installs, both localhost and on the Internet, display the thumbs much quicker, especially when the page was cached.

NOTE: I'm working localhost, so I doubt this is network related.

System is WinXP Home, Apache 1.3.27 and PHP 4.3.1, VisualMagick

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Wed, 2003-05-07 03:58

It's not regenerating the thumbnail each time, it's just slow to display them.

Gallery 1.x simply sent the browser a URL to an image which loads very quickly (and is very insecure). G2 sends the browser a link to another script which then verifies your authentication information before downloading the image. This can be a lot slower.

The current G2 code has not been optimized yet. Don't worry about the performance; we'll make it go a lot faster before we ship it.

 
konniekip

Joined: 2003-09-19
Posts: 4
Posted: Fri, 2003-09-19 18:00

I also seem to have this problem. thumbnails are not created like G1 in the map with the original JPG's. Instead they seem to be made "on the fly" whenever an album is opened. This results in waiting about 1-2 sec before a tumbnail appears....

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Fri, 2003-09-19 19:17

See my last post. Nothing has changed -- we only ever generate thumbnails once. Provide the URL to your G2 with debug mode on if you think that this is not the case and we can go over the debug output (because all image operations show up there so its easy to tell if they're happening every time or not)

 
konniekip

Joined: 2003-09-19
Posts: 4
Posted: Fri, 2003-09-19 21:17

It apperently seems to be the same "problem"; Just have to get used to the new procedure, which is indeed much safer and cool.

Running on FreeBSD 4.7 on a pentium II -280 Mhz with 64 MB RAM.

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Fri, 2003-09-19 21:31

It's definitely going to be slow on a PII for now -- but wait until I get around to doing optimization. I'm confident that I can speed up image loading by a factor of 2x.

There are a lot of benefits to the new model of only creating thumbnails when you need them. Uploading is much, much faster and if you never view the image, it never gets processed. Also, we can write a module that lets you establish a limit on the number and size of generated files (eg thumbnails, resizes, highlights, etc) and then it can delete the ones that haven't been viewed often. For example, you can say something like "Keep only 10 MB of thumbnails, and when we go over 10 MB get rid of the ones that nobody ever looks at". Haven't written that yet, of course -- but its coming!

 
Hooman

Joined: 2004-10-01
Posts: 16
Posted: Fri, 2004-10-01 15:24

I'm having the same problem. I have installed Gallery 2, and imported almubs form my old Gallery. The thumbnails load very slow. It takes about 30 seconds to load the screen with thumbs. I have looked on the server, but I can't find any thumbnails and it seems that they are being generated every time I enter any album.
The /home/user/public_html/gallery2/g2data/albums directory only contains the full size images. I looked around, but I can't seee the thumbs anywhere...

Otherwise I really like Gallery 2 and can't wait for the final release (BTW how does the timeline look like, when can we expect it?)

Thanks!

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Fri, 2004-10-01 15:51

g2data/cache/derivative

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Fri, 2004-10-01 18:20
Hooman wrote:
I'm having the same problem. I have installed Gallery 2, and imported almubs form my old Gallery. The thumbnails load very slow. It takes about 30 seconds to load the screen with thumbs. I have looked on the server, but I can't find any thumbnails and it seems that they are being generated every time I enter any album.

We generate thumbnails the first time you view them, then cache them for later. One of the problems is that the browser will request 3+ thumbnails at once, and if your server is slow, it may start thrashing trying to compute the thumbnails simultaneously. I'm planning on a solution that will let you generate the thumbnails at upload time, which would happen serially so your machine won't thrash.

Hooman wrote:
Otherwise I really like Gallery 2 and can't wait for the final release (BTW how does the timeline look like, when can we expect it?)

We're making rapid progress. I wouldn't be surprised to see a final version by the end of the year or the first month or so of next year. But, I've blown every time estimate I've ever made for G2 so don't hold me to this one either.

 
jnelson11

Joined: 2005-12-06
Posts: 6
Posted: Wed, 2005-12-07 00:27

I see that this is an old post but im having some of the same problems with this situation. I dont know if anything has ever been done about this or any new features have been added in. I also dont know if anyone else still sees the same thing that im seeing, that is the server loading thumbs very slow. I can watch the cpu performance go to 100% every time i hit refresh on a page. I just thought i would bring this topic back up again see if i can get any responses on this

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Wed, 2005-12-07 00:47

lol, you're resurrecting a > 1 year old forum thread here.

please post your issue in the support forums and post details about your server hardware, software, nr of albums / items, useralbums, are most items / albums public or private, etc.

 
jnelson11

Joined: 2005-12-06
Posts: 6
Posted: Wed, 2005-12-07 02:51

I brought this back up because i would like to know if any of the features talked about in this thread have been addressed? I am having the same issue as the guy who posted the first thread. The thumbnails load slowly on first load. What i would like to know is if there is a feature that will let me automatically create the thumbs right from the start. Or as quoted above keep X amount of megs of thumbs and dumb unrecently used thumbs?

bharat wrote:

We generate thumbnails the first time you view them, then cache them for later. One of the problems is that the browser will request 3+ thumbnails at once, and if your server is slow, it may start thrashing trying to compute the thumbnails simultaneously. I'm planning on a solution that will let you generate the thumbnails at upload time, which would happen serially so your machine won't thrash.

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Wed, 2005-12-07 03:36

- thumbnails are *not* generated on each request
- thumbnails are stored on disk
- thumbnails are generated on upload if you have the "generate thumbnails" option selected in "add items -> from browser"
- else, thumbnails are generated when first needed
- thumbnails can also be generated when going to "site admin -> maintenance -> build thumbnails and resizes"

Quote:
Also, we can write a module that lets you establish a limit on the number and size of generated files (eg thumbnails, resizes, highlights, etc) and then it can delete the ones that haven't been viewed often. For example, you can say something like "Keep only 10 MB of thumbnails, and when we go over 10 MB get rid of the ones that nobody ever looks at". Haven't written that yet, of course -- but its coming!

hasn't been implemented yet.
and this would only address disk space usage.

there have been other improvements, e.g. we added a fast download cache and a few other things to speed things up. more to come at some point.

a pentium 2 is just too slow for most g2 installs.