RENROT(1)

πŸ“¦
version 1.2.0 Β· 2 versions
, in fedora 43

πŸ’– RENROT(1) πŸ’–

okay bestie, so this is RENROT(1) from the User Contributed Perl Documentation section, and it's literally about renaming and rotating your pics using their EXIF data. no cap. let's get into it 🫢


✨ NAME ✨

renrot β€” rename and rotate images according EXIF data πŸŽ€


🌸 SYNOPSIS 🌸

renrot [OPTIONS] [[--] FILE1 FILE2 ...]

πŸ¦‹ DESCRIPTION πŸ¦‹

So renrot is designed to work on a set of files that have EXIF data in them, and it can do two things to them β€” rename and rotate. A set of files can be handed to it either explicitly, or by using the --extension option, which picks out the files with the given suffix. By default renrot operates on the files in the current working directory, unless you give it the --work-directory option, which changes that default. periodt πŸ’…

renrot renames your input files using a flexible name template β€” which, among other things, uses the DateTimeOriginal and FileModifyDate EXIF tags if they exist, and otherwise names the file according to the current timestamp. And on top of that, renrot can aggregate files according to the shooting time period, or according to a given template. ✨

Additionally, it rotates files and their thumbnails, as per the Orientation EXIF tag. If that tag is absent, the program lets you set rotation parameters using the --rotate-angle and --rotate-thumb command line options. This is currently implemented only for JPEG format. πŸŽ€

The program can also place commentaries into the following locations:

  • Commentary tag from file (see --comment-file option)
  • UserComment tag from configuration variable (see "TAGS" section)

Personal details may be specified via XMP tags defined in a configuration file, see "TAGS" section. πŸ‘‘

In addition, renrot can aggregate all files in different directories, according to a given date/time pattern template, set with --aggr-template. πŸ’œ


🌈 OPTIONS 🌈

  • -c or --config-file FILE β€” Path to the configuration file.
  • -d or --work-directory DIR β€” Define the working directory.
  • --exclude FILE β€” Specify files to exclude. Wildcards are not allowed. If a set of files is given, there must be as many occurrences of this option as there are files in the set.
  • --sub-fileset FILE β€” Get names of files to operate upon from FILE. The file must contain a file name per line. This option is useful when you need to process only a set of X from Y files in the directory. If specified, the rest of files given in the command line is ignored. πŸ‘€
  • -e or --extension EXTENSION β€” Process the files with given EXTENSION (JPG, jpeg, CRW, crw, etc). Depending on the operating system, the extension search might or might not be case-sensitive.
  • --mtime, --no-mtime β€” Defines whether to set the file's mtime, using the DateTimeOriginal tag value. Use --no-mtime to set it to current time stamp after processing.
  • --no-renrot or --nochg β€” Do not rename, rotate, tag and mtime images. It saves files from any changes while allows to do aggregation, contact sheet generation e.t.c. πŸ›Ÿ
  • --use-color, --no-use-color β€” Colorize output. This does NOT work under Windows.
  • --dry-run β€” Do not do anything, only print would have been done. (the "no thoughts, just vibes" mode 🫧)
  • -g or --generate-thumb β€” Generation and writing ThumbnailImage tag. The original value of the ThumbnailImage tag remains intact. To rewrite it you need to delete it first (look exiftool examples).
  • --use-ipc, --no-use-ipc β€” Rotate thumbnails using pipe, rather than files. This does NOT work under Windows.
  • -v β€” Increase debugging level by 1. Debugging levels from 1 to 4 are internal levels, the levels from 5 till 9 are equivalent to levels 1-5 levels ExifTool with the maximum verbosity for renrot. πŸ”
  • -? or --help β€” Display short usage summary and exit.
  • --version β€” Output version information and exit.

πŸŽ€ AGGREGATION πŸŽ€

  • --aggr-mode MODE β€” Run aggregation process in given MODE. Possible values are: none, delta or template.
  • --aggr-delta NUMBER β€” Aggregation time delta, in seconds. Files with DateTimeOriginal and ones of the previous file delta, greater than --aggr-delta are placed in the directories, with the names are constructed by concatenating the value of the --aggr-directory option and the directory name counter. πŸ—‚οΈ
  • --aggr-directory DIR β€” Aggregation directory name prefix (default is Images), have to be on the same file system (or on the file system which supports symbolic links in case of virtual aggregation), relative to the current working directory or an absolute path.
  • -a or --aggr-template TEMPLATE β€” File name template to use for file aggregation. Images are aggregated by date/time patterns. You may use combination of %d, %H, %M, %m, %S, %Y, and %y meta-characters. The template can also be defined in the configuration file (see Aggregation Template variable). The default is %Y%m%d. For the detailed description, refer to --name-template option. For practical uses, see "TEMPLATE EXAMPLES" section.
  • --aggr-virtual, --no-aggr-virtual β€” Defines virtualization for existent aggregation modes. The main effect of --aggr-virtual is that any files to be aggregated remain untouched in their places, and relative symbolic links pointing to them are stored in the directory tree created. Use --no-aggr-virtual to prevent virtualization. πŸͺ„

πŸ’… CONTACT SHEET GENERATOR πŸ’…

  • --contact-sheet, --no-contact-sheet or --cs, --no-cs β€” Create the contact sheet. Currently it works with ThumbnailImage EXIFs and the files defined as thumbnails (see the option --contact-sheet-thm, below)
  • --contact-sheet-file or --cs-file FILE β€” Base file name for montage files.
  • --contact-sheet-dir or --cs-dir DIR β€” Temporary directory for montage (created in the begining and deleted at the end of the process)
  • --contact-sheet-thm or --cs-thm β€” Files for the montage are already thumbnails

Options bellow are native ImageMagic montage options look ImageMagick documentation for montage options: montage --help and http://www.imagemagick.org/ πŸ“Έ

Note please, for COLOR use RGB triplets only like 000 for the black or F00 for the red.
  • --contact-sheet-tile or --cs-tile GEOMETRY β€” Tile MxN (IM: -tile)
  • --contact-sheet-title or --cs-title STRING β€” Set the title of the contact sheet (IM: -title).
  • --contact-sheet-bg or --cs-bg COLOR β€” Background color (IM: -background).
  • --contact-sheet-bd or --cs-bd COLOR β€” Border color (IM: -bordercolor).
  • --contact-sheet-mt or --cs-mt COLOR β€” Frame color (IM: -mattecolor).
  • --contact-sheet-fn or --cs-fn STRING β€” Render text with this font (IM: -font).
  • --contact-sheet-fl or --cs-fl COLOR β€” Color to fill the text (IM: -fill).
  • --contact-sheet-lb or --cs-lb STRING β€” Assign a label to an image (IM: -label).
  • --contact-sheet-fr or --cs-fr GEOMETRY β€” Surround image with an ornamental border in N pixels (IM: -frame).
  • --contact-sheet-pntsz or --cs-pntsz NUMBER β€” Font point size (IM: -pointsize).
  • --contact-sheet-shadow or --cs-shadow β€” Set the shadow beneath a tile to simulate depth (IM: -shadow).
  • --contact-sheet-thm-fl or --cs-thm-fl COLOR β€” Color to fill the text in generated thumbnail.
  • --contact-sheet-thm-fn or --cs-thm-fn STRING β€” Render the generated thumbnail text with this font (IM: -font).
  • --contact-sheet-thm-grfr or --cs-thm-grfr COLOR β€” Generated thumbnail background gradient COLOR-from
  • --contact-sheet-thm-grto or --cs-thm-grto COLOR β€” Generated thumbnail background gradient COLOR-to
  • --contact-sheet-thm-text or --cs-thm-text STRING β€” Generated thumbnail text
  • --contact-sheet-rank or --cs-rank β€” Run ranking process according to the ranks defined with --contact-sheet-rank-file The result is the colored frames of the thumbnails of contact sheets.
  • --contact-sheet-rank-file or --cs-rank-file β€” Path to the file with ranks. Its format is a "file rankcolor" per line. Filename separated from the color by space or tabulation.
01.file.jpg        red

02.JPG             CornflowerBlue

03.jpg             aquamarine

04.file.JPG        green

Only the files found in the file will be ranked. ⭐


🧚 KEYWORDIZER 🧚

  • --keywords, --no-keywords β€” Whether to fill Keywords tag. Default is to not. Be careful, since with this option enabled, the existing keywords are rewriten. The keywords are taken from .keywords file or file specified with option --keywords-file.
  • -k or --keywords-file FILE β€” Path to the file with keywords. Its format is a keyword per line. The CR and LF symbols are removed. Empty (only whitespace) lines are ignored. Any leading and trailing whitespace is removed. For example, the line " _Test_ CRLF" is read as "_Test_". πŸ“
  • --keywords-replace, --no-keywords-replace β€” Replace existing Keywords tag list rather than add new values to it. Default is not to replace.

✨ RENAMING ✨

  • -n, --name-template TEMPLATE β€” bestie, this is the lil template we use to cook up new file names while renaming πŸŽ€ You can also drop it in the config file (the variable is Name Template). The default is %Y%m%d%H%M%S. For real-life examples, go peek at the "TEMPLATE EXAMPLES" section below, iykyk.

The sequences it understands are, no cap:

  • %% β€” a literal %
  • %# β€” a literal #
  • %C β€” the numeric part of the original file name. This one's here for cameras that don't supply the FileNumber EXIF tag (which is currently all makes except Canon 😭). Those cameras spit out names that start with letters and end with digits. No other symbols allowed in file names except -, . and _.
  • %c β€” the ordinal number of the file in the processed set (peep the --counter-fixed-field option too).
  • %d β€” day of month (01-31)
  • %E β€” the value of the ExposureTime tag, if it's defined
  • %e β€” old file extension
  • %F β€” the value of the FNumber tag, if it's defined
  • %H β€” hour (00-23)
  • %I β€” the value of the ISO tag, if it's defined
  • %i β€” the FileNumber tag if it exists (otherwise it gets swapped for the string "NA")
  • %M β€” minute (00-59)
  • %m β€” month (01-12)
  • %n β€” previous filename (the one before renrot started processing)
  • %O β€” base part of the original filename (see %o). Like, the first part from the beginning all the way to the last dot character.
  • %o β€” the name the file had before renrot processed it for the very first time. If the file was processed only once, the tag RenRotFileNameOriginal gets set to the original file name.
  • %S β€” second (00-59)
  • %W β€” the value of the WhiteBalance tag, if it's defined
  • %Y β€” year with the century (1900, 1901, and so on)
  • %y β€” year without a century (00..99)

You can use the value of any EXIF tag as a name part πŸ’… To do that you wrap the tag name in # signs while building the name template (check "TEMPLATE EXAMPLES").

Careful though, bestie β€” any binary EXIF (like ThumbnaiImage) can produce totally unexpected results. Like, chaos. Not the cute kind. πŸ’€
  • --no-rename β€” do not rename files at all (the default is to rename them to YYYYmmddHHMMSS.ext)
  • --counter-fixed-field, --no-counter-fixed-field β€” sets a fixed length for the file counter used in file name templates (see %c). It's enabled by default, and --no-counter-fixed-field undoes that. Periodt.
  • --counter-start NUMBER β€” initial value for the file counter (default is 1)
  • --counter-step NUMBER β€” the step to increment the file counter by (default is 1)

🌸 ROTATING 🌸

  • -r, --rotate-angle ANGLE β€” defines the angle to rotate files and thumbnails by. Allowed values for ANGLE are 90, 180 or 270. Super useful for files that don't have an Orientation tag πŸ¦‹
  • --rotate-thumb ANGLE β€” rotates only thumbnails. Allowed values for ANGLE are 90, 180 or 270 degrees. Use this when your files were already rotated but their thumbnails were not. The glow-up was incomplete, we fix it.
  • --only-orientation β€” rotate by changing the value of the Orientation tag, no real rotation happens. The sequence of values to rotate an image from normal (0 degrees) by 90 degrees clockwise is: 0 -> 90 -> 180 -> 270 -> 0. So basically: set the Orientation tag to 90cw after the first rotation, and increase that value by 90 each time rotation is applied. For 270cw the rotation algorithm uses the reverted sequence. Rotation by 180cw triggers values in two pairs: 0 <-> 180 and 90 <-> 270. This option cannot be applied to mirror values of the Orientation tag β€” just so you know. πŸ’…
  • --trim, --no-trim β€” passes the -trim option to jpegtran(1) to trim if needed. By default trimming is enabled. Use --no-trim to disable it.
  • --no-rotate β€” do not rotate images (the default is to rotate according to EXIF data).

πŸŽ€ TAG WRITER πŸŽ€

  • --comment-file FILE β€” a file with commentaries. It's a low priority alias to TagFile = Comment: FILE.
  • --user-comment STRING β€” a low priority alias to --tag UserComment: STRING
  • -t, --tag TAG β€” see the section "TAGS" for the detailed description, bestie, it's all there πŸ‘‘
  • --no-tags β€” no user-defined tags will be written.

⭐ TEMPLATE EXAMPLES ⭐

The name template "01.%c.%Y%m%d%H%M%S.%i.shtr-%E.f-%F.wb-%W.iso-%I" (where F stays for FNumber, E for ExposureTime, I for ISO and W for WhiteBalance) can produce the following names:

01.0021.20030414103656.NA.shtr-1by40.f-2.8.wb-Auto.iso-160.jpg

01.0024.20040131230857.100-0078.shtr-1by320.f-2.8.wb-Auto.iso-50.jpg

01.0022.20000820222108.NA.jpg

The name template "01.%c.%Y%m%d%H%M%S.%i.shtr-#ExposureTime#.f-#FNumber#.wb-#WhiteBalance#.iso-#ISO#" can produce the following names:

01.0021.20030414103656.NA.shtr-1_40.f-2.8.wb-Auto.iso-160.jpg

01.0024.20040131230857.100-0078.shtr-1_320.f-2.8.wb-Auto.iso-50.jpg

01.0022.20000820222108.NA.jpg

The aggregation template "%Y%m%d" produces the following aggregation:

these three files

01.11.20030414103656.NA.jpg

01.12.20030414103813.NA.jpg

01.13.20030414103959.NA.jpg

will be stored in the directory 20030414, and

01.14.20040131130857.100-0078.jpg

01.15.20040131131857.100-0079.jpg

01.16.20040131133019.100-0080.jpg

will be stored in the directory 20040131. Iconic behavior, honestly. πŸ¦‹


πŸ’œ CONFIG πŸ’œ

A configuration file can be used to set some variables. Renrot looks for its configuration file, named renrot.conf, in the system configuration directories /etc/renrot and /usr/local/etc/renrot, and in the subdirectory .renrot. of the current user home directory. You can also explicitly hand it an alternate configuration file using the --config-file option.

The configuration file consists of a set of case-insensitive keywords and their values separated by an equal sign. Each such keyword/value pair occupies its own separate line. Boolean variables can have one of the following values: 0, No, False, Off, Disable for false, and 1, Yes, True, On, Enable for true.

The variables defined for use in the configuration file are, for example:

  • mtime β€” set to "Yes" to synchronize mtime with tags, otherwise set it to "No".
  • name template β€” file name template (see --name-template for the description).
  • trim β€” set to "Yes" to trim rotated images when using jpegtran(1).
  • aggregation mode β€” aggregation mode, possible values are: none, delta or template.
  • aggregation template β€” aggregation template, which defines the file aggregation (see --aggr-template for the description).
  • aggregation virtual β€” defines virtualization for the existing aggregation modes (see the --aggr-virtual option).
  • Tag, TagFile β€” refer to the section "TAGS" for the detailed description.
  • include β€” include the named file.

🌈 TAGS 🌈

A TAG is defined by the following combination: TagName [Group]: 'value'. The defined tags are selected to be set and written to the EXIF tree using the command line option --tag and/or configuration file options Tag.

The syntax of the command line option --tag is:

--tag TagName [Group]: 'value'

The syntax of the configuration file option Tag:

Tag = TagName [Group]: 'value'

The parameters TagName and Group are passed to ExifTool as is. The name of the group must be enclosed in square brackets. Its value (after the semicolon) can be enclosed in single quotes.

The TagFile keyword allows you to set multi-line tags from a file. Its syntax is:

TagFile = TagName [Group]: FILE

The following table summarizes the tags that can be used with the --tag option and Tag keyword:

  • Copyright β€” copyright notes.
  • Comment β€” general comment.
  • UserComment β€” anything you would like to put as a comment.
  • CreatorContactInfoCiAdrCity β€” a city tag.
  • CreatorContactInfoCiAdrCtry β€” a country tag.
  • CreatorContactInfoCiAdrExtadr β€” extended address (usually includes street and apartment number).
  • CreatorContactInfoCiAdrPcode β€” zip code.
  • CreatorContactInfoCiAdrRegion β€” region.
  • CreatorContactInfoCiEmailWork β€” email.
  • CreatorContactInfoCiTelWork β€” phone number.
  • CreatorContactInfoCiUrlWork β€” URL.

Additionally, you can add any known tag here, using Tag or TagFile options as described above. The customization is real. πŸ’…


🧚 FILES 🧚

  • The main configuration file renrot.conf is searched in the following locations (in the order of their appearance):
    • ~/.renrot/ β€” directory under user's home place
    • /usr/local/etc/renrot/ β€” system directory
    • /etc/renrot/ β€” system directory

Take into consideration, the files which are found will be loaded and parsed in the order when user's configuration has maximal priority. πŸ‘‘

  • Other configuration files with additional options could be included into the main file:
    • colors.conf β€” colors setup for different output facilities
    • tags.conf β€” different tags setup
  • The following files could be placed locally in the working directory:
    • .keywords β€” file with keywords (see --keywords-file)
    • .rank β€” file with ranks (see --contact-sheet-rank-file)

πŸ’€ BUGS πŸ’€

If you found some bug or have some nice propositions, you are welcome. Additionally, please, read the section RESTRICTIONS in file README.

  1. It seems that on FreeBSD 6, Perl versions 5.8.x exhibits a bug that causes renrot to crash. The overall amount of memory for the perl process increasing up to the user datasize limit (in FreeBSD default is 512M).

It seems to be a bug in perl's own malloc implementation. The bug should not occur in any perl which uses the system malloc (unless the system malloc has the same bug).

renrot aborts with the error message:

Out of memory during "large" request for XXXX bytes ...

This, however, does not happen with Perl v.5.6.x

  1. Some versions of ImageMagick render contact sheets incorrectly. It seems it is the question to ImageMagick. Not us. πŸ™ˆ

πŸ‘‘ AUTHORS πŸ‘‘

Copyright 2005-2012, Zeus Panchenko, Andy Shevchenko.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.


πŸ”₯ SEE ALSO πŸ”₯

Image::ExifTool(3pm), exiftool(1), jpegtran(1), Image::Magick(3pm)


and that's the whole page bestie!! πŸ’– this was perl v5.42.0, dated 2025-07-25 β€” RENROT(1) β€” go forth and rename slayfully βœ¨πŸŽ€

πŸ“¦ where this page comes from