RENROT(1)
π 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-fileoption) - 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 π
-cor--config-file FILEβ Path to the configuration file.-dor--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. π-eor--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 theDateTimeOriginaltag value. Use--no-mtimeto set it to current time stamp after processing.--no-renrotor--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 π«§)-gor--generate-thumbβ Generation and writingThumbnailImagetag. The original value of theThumbnailImagetag 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,deltaortemplate.--aggr-delta NUMBERβ Aggregation time delta, in seconds. Files withDateTimeOriginaland ones of the previous file delta, greater than--aggr-deltaare placed in the directories, with the names are constructed by concatenating the value of the--aggr-directoryoption and the directory name counter. ποΈ--aggr-directory DIRβ Aggregation directory name prefix (default isImages), 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.-aor--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%ymeta-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-templateoption. For practical uses, see "TEMPLATE EXAMPLES" section.--aggr-virtual,--no-aggr-virtualβ Defines virtualization for existent aggregation modes. The main effect of--aggr-virtualis 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-virtualto prevent virtualization. πͺ
π CONTACT SHEET GENERATOR π
--contact-sheet,--no-contact-sheetor--cs,--no-csβ Create the contact sheet. Currently it works withThumbnailImageEXIFs and the files defined as thumbnails (see the option--contact-sheet-thm, below)--contact-sheet-fileor--cs-file FILEβ Base file name for montage files.--contact-sheet-diror--cs-dir DIRβ Temporary directory for montage (created in the begining and deleted at the end of the process)--contact-sheet-thmor--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 like000for the black orF00for the red.
--contact-sheet-tileor--cs-tile GEOMETRYβ Tile MxN (IM:-tile)--contact-sheet-titleor--cs-title STRINGβ Set the title of the contact sheet (IM:-title).--contact-sheet-bgor--cs-bg COLORβ Background color (IM:-background).--contact-sheet-bdor--cs-bd COLORβ Border color (IM:-bordercolor).--contact-sheet-mtor--cs-mt COLORβ Frame color (IM:-mattecolor).--contact-sheet-fnor--cs-fn STRINGβ Render text with this font (IM:-font).--contact-sheet-flor--cs-fl COLORβ Color to fill the text (IM:-fill).--contact-sheet-lbor--cs-lb STRINGβ Assign a label to an image (IM:-label).--contact-sheet-fror--cs-fr GEOMETRYβ Surround image with an ornamental border in N pixels (IM:-frame).--contact-sheet-pntszor--cs-pntsz NUMBERβ Font point size (IM:-pointsize).--contact-sheet-shadowor--cs-shadowβ Set the shadow beneath a tile to simulate depth (IM:-shadow).--contact-sheet-thm-flor--cs-thm-fl COLORβ Color to fill the text in generated thumbnail.--contact-sheet-thm-fnor--cs-thm-fn STRINGβ Render the generated thumbnail text with this font (IM:-font).--contact-sheet-thm-grfror--cs-thm-grfr COLORβ Generated thumbnail background gradient COLOR-from--contact-sheet-thm-grtoor--cs-thm-grto COLORβ Generated thumbnail background gradient COLOR-to--contact-sheet-thm-textor--cs-thm-text STRINGβ Generated thumbnail text--contact-sheet-rankor--cs-rankβ Run ranking process according to the ranks defined with--contact-sheet-rank-fileThe result is the colored frames of the thumbnails of contact sheets.--contact-sheet-rank-fileor--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 fillKeywordstag. Default is to not. Be careful, since with this option enabled, the existing keywords are rewriten. The keywords are taken from.keywordsfile or file specified with option--keywords-file.-kor--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 existingKeywordstag list rather than add new values to it. Default is not to replace.
β¨ RENAMING β¨
-n,--name-templateTEMPLATE β 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 isName 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 theFileNumberEXIF 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-fieldoption too).%dβ day of month (01-31)%Eβ the value of theExposureTimetag, if it's defined%eβ old file extension%Fβ the value of theFNumbertag, if it's defined%Hβ hour (00-23)%Iβ the value of theISOtag, if it's defined%iβ theFileNumbertag 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 tagRenRotFileNameOriginalgets set to the original file name.%Sβ second (00-59)%Wβ the value of theWhiteBalancetag, 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 toYYYYmmddHHMMSS.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-fieldundoes that. Periodt.--counter-startNUMBER β initial value for the file counter (default is1)--counter-stepNUMBER β the step to increment the file counter by (default is1)
πΈ ROTATING πΈ
-r,--rotate-angleANGLE β defines the angle to rotate files and thumbnails by. Allowed values for ANGLE are90,180or270. Super useful for files that don't have anOrientationtag π¦--rotate-thumbANGLE β rotates only thumbnails. Allowed values for ANGLE are90,180or270degrees. 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 theOrientationtag, 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 theOrientationtag to90cwafter the first rotation, and increase that value by 90 each time rotation is applied. For270cwthe rotation algorithm uses the reverted sequence. Rotation by180cwtriggers values in two pairs:0 <-> 180and90 <-> 270. This option cannot be applied to mirror values of theOrientationtag β just so you know. π--trim,--no-trimβ passes the-trimoption tojpegtran(1)to trim if needed. By default trimming is enabled. Use--no-trimto disable it.--no-rotateβ do not rotate images (the default is to rotate according to EXIF data).
π TAG WRITER π
--comment-fileFILE β a file with commentaries. It's a low priority alias toTagFile = Comment: FILE.--user-commentSTRING β a low priority alias to--tag UserComment: STRING-t,--tagTAG β 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-templatefor the description). - trim β set to
"Yes"to trim rotated images when usingjpegtran(1). - aggregation mode β aggregation mode, possible values are:
none,deltaortemplate. - aggregation template β aggregation template, which defines the file aggregation (see
--aggr-templatefor the description). - aggregation virtual β defines virtualization for the existing aggregation modes (see the
--aggr-virtualoption). - 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.confis 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 facilitiestags.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.
- 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
- 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
- fedora 43: renrot 1.2.0-28.fc43 Β· Artistic-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms