GithubHelp home page GithubHelp logo

racheliee / rename_images Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 1.0 6 KB

Rename images and videos in a directory by the date & time they were created.

Python 100.00%
heic images jpg mp4 png rename videos

rename_images's Introduction

rename images & videos with date taken

Purpose

This code is used to rename image & video files in a directory using the EXIF data of the file. (If no EXIF data exists, the last modified date will be used).

Usage

Put the code in the directory where the images & videos are located. Run the code.

Renaming Behaviour

The code will rename the files in the directory with the following format:

YYYYMMDD_HHMM.ext

Ex:
Given a photo named IMG_0000.jpg taken on 2019/01/01 at 12:00, the code will rename it to:

20190101_1200.jpg

If there are multiple files taken at the same time, the code will append a number to the end of the file name.

Ex:
Given a photo named IMG_0000.jpg taken on 2019/01/01 at 12:00 and another photo named IMG_0001.jpg taken on 2019/01/01 at 12:00, the code will rename them to:

20190101_1200.jpg
20190101_1200_1.jpg

If a photo does not have EXIF data, the last modified date of the image/video file will be used. (Since videos most often do not have EXIF data, it will use the last modified date).

Supported Extensions

The code will rename files with the following extensions:

  • heic
  • jpg
  • jpeg
  • png
  • mov
  • mp4

Dependencies

Install exifread to read exif data from images pip install "exifread<3" (for mac silicon users) otherwise, install the regular exifread version

rename_images's People

Contributors

racheliee avatar shj1081 avatar

Watchers

 avatar

Forkers

shj1081

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.