Unique filename

Hello,

In a multi user environment with many different cameras there will be a risk for users trying to upload images to the same album with the same filename.

Is there an easy way to modify Zenphoto ensure that filenames are keept unique?

Regards,

Perry Jönsson

Comments

  • assign each user a unique upload album.
  • Well, the problem still exist with non-unique filenames.

    I plan to use Zenphoto with users that have very basic computer skills.

    When they extract photos from the camera it is done from Windows and images will be named 001, 002, 003 etc.

    (Yes, this could be solved with education... However, since they are using many different cameras you can no rely on the unique filenames from the camera itself.)

    Further, I would also like users to collaborate and be able to upload new photos to others albums as well.

    So, back to my question again.
    How much work would be involved to modify Zenphoto to create unique filenames?

    Regars,

    Perry
  • acrylian Administrator, Developer
    It could probably be done with a plugin using filters. That plugin would have to compare all images on the file system with the one you upload and rename it accordingly. The standard filter-zenphoto_seo.php plugin might act as a template for this. Best you take a look at that and read also the article about the plugin system.
  • OK I will have a look on the plugin.

    My general idea as a quickfix would be to modify the upload function. If the upload function can perform a SQL query to get a database index, it could then simply ad a index to the filename.

    (this would require that you disable the possibility to add photos via Windows Explorer).

    Is there any logic or other issue I have overlooked with such solution?

    Further - is this a feature/modification that would be suitable for a permanent implementation in future versions of Zenphoto?

    /Perry
  • acrylian Administrator, Developer
    My general idea as a quickfix would be to modify the upload function. If the upload function can perform a SQL query to get a database index, it could then simply ad a index to the filename.
    As said that can be done with the filters you can hook that to the upload. Querying the database is a way but note if anyone uploads via FTP meanwhile that file might not be noted in the database. Zenphoto adds them on discovery because it is filesystem based (see the troubleshooting entry of that). Of course if noone uploads via FTP that should be no issue.

    (this would require that you disable the possibility to add photos via Windows Explorer).
    I don't know what you mean by that actually. Zenphoto has of course no means to disable anything on Windows or any other system.

    Further - is this a feature/modification that would be suitable for a permanent implementation in future versions of Zenphoto?
    Maybe, it should be a plugin in any case so permanent is a little relative..;-)

    If you would like to start this plugin, best open a ticket and assign that to yourself. You should work with a current nightly build to be save for the next release scheduled in Januaray. Also please read the developer and general contributor guidelines articles on our user guide.
Sign In or Register to comment.