the meaning of serialNumber ?

zelo

Joined: 2004-06-22
Posts: 8
Posted: Tue, 2005-03-22 15:20

Could anybody explain the meaning of serialNumber ?
It seems that it is used to distinguish different-sized versions of one item.
If so, what's the rule in numbering ?
2 is a thumbnail ? what else ?

('serialNumber' is used like this in the url:
http://localhost/gallery2/main.php?g2_view=core:DownloadItem&g2_itemId=237&g2_serialNumber=1)

PS. I searched the forum and the mailing list but I could not find any answer.

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Tue, 2005-03-22 16:04

it is not for different resizes of the same image, but for different versions of the same file.. for example you upload an image and it creates the thumbnail, with serial number 1.. now you go into the album settings and change the thumbnail size and check "rebuild thumbs".. it rebuilds the thumbnail and changes the serial number to 2. why? browsers check with the webserver to make sure files have not changed so it can used its own cached file.. with this system it is easy for G2 to answer these requests, as the answer is always yes.. (if the image changed the serial number would change so the browser wouldn't try to used a cached image.. new url)

 
zelo

Joined: 2004-06-22
Posts: 8
Posted: Tue, 2005-03-22 16:56

Thank you very much for your answer!

I also found out that if I change the view size (imageViewsIndex) of a photo, the urls of photos (in the img tag) with different sizes have all different itemId, not different serialNumber !
That was not what I expected. There should be some interesting rule to decide the (itemId, serialNumber) pair.

BTW, what does the serialNumber mean for movies ?
G2 does not resize movies and thumbnails of movies have differnt itemId's.
Is this left for future extension ?

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Tue, 2005-03-22 17:34

all items have a serial number, it doesn't matter what type of file.