 | |  | | | Photopost Pro Bug Reports Post post installation PhotoPost Pro problems here. |
November 27th, 2005, 06:42 PM
|
#1 (permalink)
| | Member Verified Customer
Join Date: Dec 2002
Posts: 100
| Problem with same filenames during moving between categories
Starting from some version of the PP (5.0 ?) there was changed the system of images filenames in the database. And we have the next problem.
For example, there is already file qwerty.jpg in the category ABC. If user trying to upload one more file qwerty.jpg to the same category, his file will get name qwerty1.jpg and will be placed into the same directory.
But if user uploaded one more file qwerty.jpg to the different category, say category DEF, his file will be accepted by system under the original name qwerty.jpg. OK, no problem, both files are in a different directories and there are no any conflicts.
Well, if after that file (page) qwerty.jpg will be moved from the category ABC to the category DEF, we getting a problem. File in the category DEF will be overwritten by file with the name, originally placed into the category ABC. So we have two different pages but with one image file.
That is not a fantasy but real situation. Users often don't care about filenames and simply uses 1.jpg or q.jpg etc.
How to resolve it?
|
| |
November 27th, 2005, 07:16 PM
|
#2 (permalink)
| | Photopost Developer Verified Customer
Join Date: Jun 2002 Location: Abingdon,MD
Posts: 66,809
|
Well don't know what to tell you about already uploaded ones but we can change it for new ones. In uploadphoto.php lines 490-512 delete the code in bold and instead of checking for just the category on upload it will search all and change it to the right name Code: Content visible to verified customers only.
|
| |
November 28th, 2005, 02:39 AM
|
#3 (permalink)
| | Member Verified Customer
Join Date: Dec 2002
Posts: 100
|
Sorry, Chuck, there are no code marked in bold in the above quoting
|
| |
November 28th, 2005, 02:46 AM
|
#4 (permalink)
| | Member Verified Customer
Join Date: Dec 2003 Location: Michigan. USA
Posts: 200
| Quote: |
Originally Posted by charm Sorry, Chuck, there are no code marked in bold in the above quoting | cat=$category AND
|
| |
November 28th, 2005, 02:59 AM
|
#5 (permalink)
| | Member Verified Customer
Join Date: Dec 2002
Posts: 100
|
Thank you, I see now
|
| |
November 28th, 2005, 04:09 AM
|
#6 (permalink)
| | Member Verified Customer
Join Date: Dec 2002
Posts: 100
|
The problem with existing files can be resolved, if to edit photo and upload the same picture but with new file name.
But in the current version it is impossible. During editing the reuploaded file receives the name of the file that is already in the system.
|
| |
November 28th, 2005, 05:05 AM
|
#7 (permalink)
| | Member Verified Customer
Join Date: Dec 2002
Posts: 100
|
I removed code as you recommended but it doesn't help. File name is changed, only if the same file in the uploading category exist. In other cases it remains unrenamed.
|
| |
November 28th, 2005, 09:58 AM
|
#8 (permalink)
| | Photopost Developer Verified Customer
Join Date: Jun 2002 Location: Abingdon,MD
Posts: 66,809
|
You can't upload it as the same name it will not take on editphoto. when uploading a PHOTO again it must always be renamed different. It if is the same it is dropped
As stated the fix I have given is go forward meaning it fixes this issue from here on out. This has been tested thoroughly. If I upload the same picture 4 times to 4 different categories they are renamed accordingly
There is no fix for you moving files with existing ones. Other than to reupload the files with a slightly different name or I can give you a little snippet of code to check for a file the same name and die if it is found
In editphoto.php around line 431 Code: Content visible to verified customers only.
|
| |
November 28th, 2005, 11:39 AM
|
#9 (permalink)
| | Member Verified Customer
Join Date: Dec 2002
Posts: 100
| |
| |
November 28th, 2005, 11:58 AM
|
#10 (permalink)
| | Photopost Developer Verified Customer
Join Date: Jun 2002 Location: Abingdon,MD
Posts: 66,809
|
Then you have not applied this code as I have posted here in post 2
I have uploaded the edited file myself since we just did your upgrade
Go ahead and try it
|
| |
November 28th, 2005, 03:45 PM
|
#11 (permalink)
| | Member Verified Customer
Join Date: Dec 2002
Posts: 100
| |
| |
November 28th, 2005, 04:10 PM
|
#12 (permalink)
| | Photopost Developer Verified Customer
Join Date: Jun 2002 Location: Abingdon,MD
Posts: 66,809
|
works just fine
I uploaded the same image 2 times the filenames are shown right on screen here they are all incremented http://www.zeno.ru/index.php |
| |
November 28th, 2005, 04:24 PM
|
#13 (permalink)
| | Member Verified Customer
Join Date: Dec 2002
Posts: 100
|
So this improvement affects only on a new (later than 29-Nov) files? If we already have file.jpg in the system (uploaded before 29-Nov), and tomorrow will try to upload file.jpg again, it will be not inceremented?
|
| |
November 28th, 2005, 04:29 PM
|
#14 (permalink)
| | Photopost Developer Verified Customer
Join Date: Jun 2002 Location: Abingdon,MD
Posts: 66,809
|
No I did not say that. It works for all new uploads it scans the entire photos table looking for the filename
|
| |
November 28th, 2005, 04:38 PM
|
#15 (permalink)
| | Member Verified Customer
Join Date: Dec 2002
Posts: 100
|
In that case I don't understand why my last uploads didn't incremented ...
|
| |
November 28th, 2005, 04:54 PM
|
#16 (permalink)
| | Photopost Developer Verified Customer
Join Date: Jun 2002 Location: Abingdon,MD
Posts: 66,809
|
Mine did on yours as you can see
|
| |
November 28th, 2005, 04:59 PM
|
#17 (permalink)
| | Member Verified Customer
Join Date: Dec 2002
Posts: 100
|
I uploaded image under 'admin' login for user 'charm', using bulkupload. Can it be a reason that filename was not incremented?
|
| |
November 28th, 2005, 05:09 PM
|
#18 (permalink)
| | Photopost Developer Verified Customer
Join Date: Jun 2002 Location: Abingdon,MD
Posts: 66,809
|
Every query for all 6 imagecheck queries is this
$catq = ppmysql_query("SELECT id FROM {$Globals['pp_db_prefix']}photos WHERE bigimage='$realname'", $link);
It works as I just did it again
You uploaded an image named 1.jpg so I renamed one of my images 1.jpg and uploaded it was renamed to 150.jpg meaning it found 149 other files named 1 on your photos table
So this clearly works http://www.zeno.ru/index.php |
| |
November 30th, 2005, 02:27 AM
|
#19 (permalink)
| | Member Verified Customer
Join Date: Jan 2004
Posts: 220
|
To fix the problem for photos that are already in the database, a check could be applied to editphoto.php. Before moving the file to the new category, check if there's already an image with this filename. If so, rename it and also change the filename in the photos table.
Or would this cause problems I'm not aware of?
|
| |
November 30th, 2005, 08:38 AM
|
#20 (permalink)
| | Photopost Developer Verified Customer
Join Date: Jun 2002 Location: Abingdon,MD
Posts: 66,809
|
It shouldn't
|
| | |
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 04:53 PM. | |