![]() |
|
Auto Increment - Printable Version +- ZenphotoCMS Forum (https://forum.zenphoto.org) +-- Forum: Support (https://forum.zenphoto.org/forum-1.html) +--- Forum: General support (https://forum.zenphoto.org/forum-4.html) +--- Thread: Auto Increment (/thread-10845.html) |
Auto Increment - Ralf - 2013-02-14 Hi, I was wrong that I suspected the sitemap plugin - but there is a question mark left for me. Here is the scenario: Yesterday I have uploaded 4 new images - a control of the database shows me for the images table: Then I have visited the gallery and viewed one of the new images in detail view. I am just wondering what has caused the auto-increment value to change from 1186 to 1191. Because the table already showed 1185 before visiting I see no reason why the auto-increment value changed to a new value. Again: I just want to understand what happens here :-) Ralf Auto Increment - acrylian - 2013-02-14 If auto increment is used as we do it always starts with the greatest value present if adding new elements. So if you have values from 1 to 2000 and delete entry value 1999, the next will still get 2001 as a value. "Free" values inbetween are not re-assigned. That means if you have numbers missing you probably have deleted images or albums sometime in the past. http://stackoverflow.com/questions/4562479/how-does-mysql-auto-increment-work Auto Increment - Ralf - 2013-02-14 Hi Acrylian, and this is exactly what makes me wonder. I have not deleted albums or pictures. So I see no reason why the auto-increment value has changed. Cheers Auto Increment - acrylian - 2013-02-14 Then I have no idea actually. Auto Increment - Ralf - 2013-02-14 Does not matter :-) Auto Increment - Ralf - 2013-06-01 Hi, I still can reproduce it with the following steps:
Before step 4 the images table looks like: After performing the sitemap creation in step 4 it looks like: Beneath the auto increment value in the images table, the auto increment value also changes in the obj_to_tag table. I have no idea what happens here, it seems to be template independant because I could reproduce it also with the standard templates. The only thing I can imagine: Would be great if someone can give me a hint. Cheers Auto Increment - sbillard - 2013-06-01 If the database has all the image records in it when you check, it has discovered the images. Caching really has nothing to do with this and occurs only when a specific image size is requested that is not already in the cache. The behavior you describe suggests that Zenphoto thinks the images are "new" when they are looked at. (The old records would go away if Zenphoto discovers the images not there.) Exactly how that might happen is beyond my imagination. But some things that you can check: For the same image are do the "before" and "after" records contain exactly the same data. If not, what is different. Check your table structure's indexes. You should have two indexes for images, the id and filename+albumid. If those are not there it would be possible to get duplicate records which might later be purged. See what happens if you wait to do the sitemap until after you have "used" the site for a while. See if the ids have increased. Auto Increment - Ralf - 2013-06-01 Hi sbillard, thanks for your explanation. I have already checkd if there are differences - there are none. Next time i create the sitemap after I the site is used for a while. Cheers Auto Increment - Ralf - 2013-06-01 Here is what I found out: Based on the example above with the image named: This will become: So my guess is that after the sitemap runs zenphoto thinks that it is a new image because of the small w instead of the W. At the moment I start from scratch renaming the images to 'small letters'. I ran a test with 100 images, created the sitemap and the id numbers remain the same. So I think this was the problem. Cheers Auto Increment - sbillard - 2013-06-01 It would indeed be a new image, but I do not know where that change of case would be happening. Unless you are running the seo_cleanup plugin. But even that plugin should have done the rename "properly" so that Zenphoto would know it was the same image. Auto Increment - Ralf - 2013-06-02 Hi sbillard, my favorite guess: Converted the filename to: All images are online now (1641) at: I ran the seo-cleanup and the sitemap generation several times. Looks good :-) Cheers Auto Increment - acrylian - 2013-06-02 Since servers do make a difference in the case which most normal systems (like Mac OS) don't, BurgersZoo.jpg and burgerszoo.jpg would be different files. Auto Increment - Ralf - 2013-06-03 Hi, just want to let you know that it was indeed the filenaming which caused problems all the time. Since I have renamed them all to 'small letters' anything is fine. And yes i am happy that I got my gallery running :-) Cheers |