npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

photo_rename

v0.1.7

Published

Rename JPG files to IMG_yyyymmdd_hhmmss.jpg

Downloads

2

Readme

Photo Rename

This is a Nodejs port of my original script written in Ruby. Currently it provides around 80% of the functionality of the original, and everything that I needed for my personal use. The plan is to deprecate the Ruby script since I am now mostly working in Nodejs and are much more capable in that language.

NPM

Installation

The only dependency is for the script is that Nodejs and npm be installed. Other depenedencies will be automatically installed by npm.

To install the script itself:

npm install photo_rename

What the script does

This script is fairly specific. It renames all JPG files (technically files with a .jpg or .jpeg extenstion) in a given directory to the form IMG_yyyymmdd_hhmmss.jpg

Rationale

The naming pattern described above is the naming pattern used by the stock Android camera. Renaming photos taken with other devices to this scheme allows me to seamlessly merge photos into a single directory and maintain consistent file names.

Usage

photo_rename [directory]

img

Changing the image date

It is quite common (at least for me) that my camera time is incorrect. This happens most often to me when traveling to a different time zone.

Although I started implementing this functionality into the app, I decided to stick to the Unix philosophy of letting the app "do one thing well". There are many different tools that are better suited to changing an image's exif data. Personally I use jhead. It does everything I need and is simple to learn.

Lets look at an example:

If I take my photos while in EST, but my camera was set to CST, I have to adjust the time forward with 1 hour.)

jhead -ta+1:00 ~/my_photos/*

Then I run photo_rename on the same directory

photo_rename ~/my_photos

Or if you want to do it all in one command:

cd ~/my_photos && jhead -ta+1:00 * && photo_rename

Renaming RAW files

Since v0.1.6 of the app you can rename corresponding RAW files (or any file really) together with the JPEG file.

Since RAW file extensions seem to vary quite a lot, you need to specify the file extension for your particular case. The algorithm will look for files with that extension that have the same base name as a JPEG file. These two files will be renamed together with the new date based name.

For example, lets say my camera created the following two files after I take a photo:

P1010880.JPG
P1010880.RW2 

Given the following command:

photo_rename -e RW2 .

will result in the files being renamed as:

IMG_20160820_091854.jpg
IMG_20160820_091854.RW2

License

This program is licensed under GNU GPL