Blog

Filenames

published 2024-05-15 by pp

I had always named the image files in this way:

  • 2006-dreim2.jpg
  • 2014-flatpocket.jpg
  • 2022-verdammt.jpg

Or, when I didn't know the year, then so:

  • xxxx-amiskindoor.jpg
  • xxxx-aslline.jpg

and so on..

Now I started another way of naming them, because one day, when Rocket offers Authentication, or I find another way to build that, I want to build an upload function again. And then it would be good to have an automatic naming scheme for the images.

I found there exists "uuidgen", a command line tool, here on my Linux system.. You type "uuidgen" and get a UUID: c7dd076d-a5f0-449a-b3b9-530ed7355061 .

So I started naming the images like "c7dd076d-a5f0-449a-b3b9-530ed7355061.jpg"

Then I found another tool, that makes shorter IDs, which is called short-uuid and produces IDs like this: "v4VQKps3TCFbLxHyzpeZ42" which I found better. So now I am renaming all images in this way:

"v4VQKps3TCFbLxHyzpeZ42.jpg"

Maybe I will also use these IDs for the URL as identifier.. So "flavuur.de/photos/1234" would become "flavuur.de/photos/v4VQKps3TCFbLxHyzpeZ42" but I'm not sure, yet..