• @[email protected]
    link
    fedilink
    41 year ago

    I actually need to standardize my code. I’ve got “learning F2” as something I want to do soon. The goal: use the exif data of my pictures to create [date in ISO 8601] - [original filename].[original file type termination]

    So a picture taken the third of march 2022 titled “asdf.jpg” would become “2022-3-3 - asdf.jpg”

    Help? lol

    • @[email protected]
      link
      fedilink
      61 year ago

      If you’re on Linux exiftool can get the creation date for you: exiftool -p '$CreateDate' -d '%Y-%m-%d' FILENAME, and you could run tgat in a loop over your files, something like:

      mkdir -p out
      for f in *.jpg
      do
      createdate=$(exiftool -p '$CreateDate' -d '%Y-%m-%d' "${f}")
      cp -p "${f}" "out/${createdate} - ${f}"
      done
      

      Obviously don’t justbgo running code some stranger just posted on the internet, especially as I haven’t tested it, but that should copy images from the current directory to a subdirectory called ‘out’ with the correct filenames.

      • metaStatic
        link
        fedilink
        21 year ago

        ok I think I finally need to ask

        What the fuck is up with the html code? Ive seen this in a lot of posts and it just throws me every time.

    • @cerberus
      link
      English
      11 year ago

      Can you give more context, what are you using? Language / system / etc?

      • @[email protected]
        link
        fedilink
        11 year ago

        I’m using NixOS. Ext4 filesystem. As to language, I’m not entirely sure what you mean. If you refer to the character set in the filenames, I think there are no characters that deviate from the English alphabet, numbers, dashes, and underscores.

        • @cerberus
          link
          English
          11 year ago

          Oh ok so you’re more so working with folder structure etc, so bash for when you plug-in a card?

          I’m thinking in more programmatic terms, there’s definitely some bash scripting you can execute. Or just go balls out and write a service that executes on systemctl