Author Topic: image name check  (Read 3885 times)

0 Members and 1 Guest are viewing this topic.

Offline thecaretaker

  • album.pl Donor
  • album.pl Tester
  • **
  • Posts: 37
  • Karma: +0/-0
  • I love photo album.pl
    • The Caretakers' Website
image name check
« on: June 16, 2005, 16:25:33 »
I've had this problem a couple of times now, each time it seems to take me ages to work out whats going on.

Would it be possible to do a check in the folder your uploading to (before the upload) that the name of the image doesn't already exist?

I run a monthly photo competition now, Have set 12 folders within a folder January to December. Only I have permission to upload to this folder. This month, the theme is Twins. I had 2 users send me an image with the same name. twins and Twins. It took me 20 minutes to work out why the software kept renaming one of the existing image titles. It's happened before without me realising it. But it is infrequent, so had a job to remember what it was that caused it before.

A non-case sensitive check of the image name would be really handy. With a pop up warning that a file of the same name already exists.

For a man of your programming abilities, you'd probably find that a pretty easy one to fix ;D

Offline thecaretaker

  • album.pl Donor
  • album.pl Tester
  • **
  • Posts: 37
  • Karma: +0/-0
  • I love photo album.pl
    • The Caretakers' Website
Re: image name check
« Reply #1 on: June 16, 2005, 16:41:06 »
oooh. Double wammy. Just had a member log in with a capital Axxxx not a small axxxx which created a new album with a capital Axxxx which renamed the original folder with a capital (well, didn't rename the folder, just changed the name that was displayed for the folder). (you still with me here).

So it's a album wide issue, even with logging in. I assume the server does realise that Axxxx and axxxxx can be different as I do have 2 folders one with a capital and one with lower case. But the code in the album reads it as the same and shows 2 folder names with a capitial Axxxx. It must be the 'title' code routine that displays folders title, image name etc that can't see any difference. Now that might not be so easy to sort out :-X
« Last Edit: June 16, 2005, 16:46:13 by thecaretaker »

Offline Mike Bobbitt

  • album.pl Author
  • Administrator
  • I Spend Too Much Time Here
  • *****
  • Posts: 3381
  • Karma: +35/-2
    • Mike's Development Archive
Re: image name check
« Reply #2 on: June 16, 2005, 17:59:09 »
Actually this *should* be a pretty easy fix. In album.pl, find/edit:

Code: [Select]
# Found the description we're looking for (not via the search screen)
if ($descline=~/^$desctosearch$/i || $descline=~/^$desctosearch:.*$/i)

and take out the i (for case insensitive):

Code: [Select]
# Found the description we're looking for (not via the search screen)
if ($descline=~/^$desctosearch$/ || $descline=~/^$desctosearch:.*$/)

It won't work "retroactively" but should work the next time the twins/Twins problem occurs...

Thanks for bringing it up!


Cheers
Mike

Offline thecaretaker

  • album.pl Donor
  • album.pl Tester
  • **
  • Posts: 37
  • Karma: +0/-0
  • I love photo album.pl
    • The Caretakers' Website
Re: image name check
« Reply #3 on: June 18, 2005, 03:42:32 »
Your a wonderful man! Thanks for looking at that. I've altered the code and will report back if I find any problems with it. Who would have thought an 'i' could make such a difference ;D

Thanks for your continued support and dedication to this project. You don't get support like this if you buy software that costs 100s, let alone free! You should be knighted! ;)