 | |  | | | Photopost Pro Bug Reports Post post installation PhotoPost Pro problems here. |
December 20th, 2006, 06:31 AM
|
#1 (permalink)
| | Member Verified Customer
Join Date: Jan 2004
Posts: 218
| 5.62 Moving images can overwrite existing images
A problem that pops up frequently and is really annoying for our users:
In PP filenames are unique per category. So if you upload an image called foo.jpg to a category which already does contain an image with that filename, it gets renamed to foo1.jpg.
This automatic renaming doesn't exist if you move a file from one category into another. Then, the physical file get's overwritten.
So please check the filenames on moving and rename the moved image if necessary to prevent data loss.
|
| |
December 20th, 2006, 09:16 AM
|
#2 (permalink)
| | Photopost Developer Verified Customer
Join Date: Jun 2002 Location: Abingdon,MD
Posts: 52,666
|
I dont think Michael has come up with a backward compatible way to do this on moving a photo but I do know we removed the per category check and made it a global check a long time ago. Thus it is people with older systems who might move older photos that would have this issue.
|
| |
December 20th, 2006, 09:37 AM
|
#3 (permalink)
| | Member Verified Customer
Join Date: Jan 2004
Posts: 218
|
Maybe a script that scans the complete database and checks for duplicate names would do it? That could be used for "older systems" and no changes to the current code would be necessary.
|
| |
December 20th, 2006, 09:54 AM
|
#4 (permalink)
| | PhotoPost Developer Verified Customer
Join Date: Jan 2002
Posts: 11,736
|
In 5.62, we look for filenames that match regardless of which category they are in - if an image within the system has the same name, then it gets a new name; which would prevent any overwriting in the future.
There was a bug in a prior 5.5 release that did check explicitly for category names before renaming a file and that was fixed in an update. While uploading, you should not end up with two files with the same name in any category; as for existing duplications, we do not have a mechanism for that.
__________________ Please do not PM me for support or sales questions. Thank you for your understanding. |
| |
December 20th, 2006, 09:59 AM
|
#5 (permalink)
| | Member Verified Customer
Join Date: Jan 2004
Posts: 218
|
Ok, I understand that, but we have about 90.000 images that have been uploaded with PP < 5.5 and that might be moved around. So the question is how to address the inconsistent data that has been caused by this bug. That's why I proposed a "cleanup" script to address this issue.
|
| |
December 20th, 2006, 10:40 AM
|
#6 (permalink)
| | PhotoPost Developer Verified Customer
Join Date: Jan 2002
Posts: 11,736
|
I'll see what I can do. To see if this effects other images, try this query (be sure to use your table prefix): Code: Content visible to verified customers only.
Only results with more than 1 are actual duplicates and, also keep in mind that queries are not case sensitive; so its possible to have two filenames that don't overwrite one another on Linux systems.
__________________ Please do not PM me for support or sales questions. Thank you for your understanding. |
| |
December 20th, 2006, 10:44 AM
|
#7 (permalink)
| | Member Verified Customer
Join Date: Jan 2004
Posts: 218
|
Thanks, Michael!
Query returned 1,892 total.
|
| |
December 20th, 2006, 10:53 AM
|
#8 (permalink)
| | Member Verified Customer
Join Date: Jan 2004
Posts: 218
|
Might be helpful for others. This query returns only results with more than 1 duplicate: Code: Content visible to verified customers only.
On my installation, this are 873 total
|
| |
December 20th, 2006, 12:48 PM
|
#9 (permalink)
| | PhotoPost Developer Verified Customer
Join Date: Jan 2002
Posts: 11,736
|
Okay, I've attached a script I wrote and tested in my viperalley.com website which cleaned up about 60 duplicate filenames.
I make no warrenties for this script and it's use; the code seems proper and it worked on my site for the 60 dupes I had. I suggest you check it yourself and backup your photos table before you run it (and even your data directory).
There is error checking built-in - but again, you should review it for yourself and be sure you understand what it is doing before running it.
__________________ Please do not PM me for support or sales questions. Thank you for your understanding. |
| |
December 20th, 2006, 01:06 PM
|
#10 (permalink)
| | Member Verified Customer
Join Date: Jan 2004
Posts: 218
|
Thanks Michael, I'll test it on Saturday and report back to you.
|
| |
December 24th, 2006, 07:05 PM
|
#11 (permalink)
| | Member Verified Customer
Join Date: Jan 2004
Posts: 218
|
Worked like a charm, thank you!
|
| |
December 25th, 2006, 12:00 AM
|
#12 (permalink)
| | Photopost Developer Verified Customer
Join Date: Jun 2002 Location: Abingdon,MD
Posts: 52,666
|
Merry Christmas
|
| | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | | | | Thread Tools | | | | Display Modes | Rate This Thread | Linear Mode | |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is Off | | | All times are GMT -5. The time now is 10:23 AM. | |