RENROT(1p)
πΈ renrot(1p) β rename + rotate ur pics by their EXIF, no cap π
okay bestie, welcome to renrot(1p), straight out of the User Contributed Perl Documentation. it renames and rotates images according to EXIF data, and honestly? it's giving main character energy for ur whole photo library. π
β¨ NAME β¨
renrot β rename and rotate images according EXIF data π¦
β¨ SYNOPSIS β¨
renrot [OPTIONS] [[--] FILE1 FILE2 ...]
β¨ DESCRIPTION β¨
so like, Renrot is built to work with a set of files that contain EXIF data, and it does two things to them β rename and rotate. periodt.
u can hand it a set of files two ways: explicitly, or with the --extension option, which grabs all the files with the suffix u gave it. and where does it operate? in the current working directory, unless u pass --work-directory and change that default. easy.
Renrot renames ur input files using a flexible name template (which, among other things, uses the DateTimeOriginal and FileModifyDate EXIF tags if they exist β and if they don't, it just names the file according to the current timestamp, nbd). and further? it can aggregate files according to the shooting time period, or according to a template u give it.
on top of that, it rotates files and their thumbnails, as per the Orientation EXIF tag. if that tag isn't there, the program lets u set rotation params with the --rotate-angle and --rotate-thumb command line options. heads up tho: this is currently implemented only for JPEG format. π
the program can also drop commentaries into these locations:
Commentarytag from file (see the--comment-fileoption)UserCommenttag from configuration variable (see the "TAGS" section)
personal details can be specified via XMP tags defined in a configuration file β again, see the "TAGS" section. iykyk. π
and one more thing: renrot can aggregate all files in different directories according to a given date/time pattern template, set with --aggr-template. slay.
β¨ OPTIONS β¨
-c,--config-fileFILE β path to the configuration file. ποΈ-d,--work-directoryDIR β define the working directory.--excludeFILE β specify files to exclude. β οΈ wildcards are not allowed. if u give a set of files, there has to be as many occurrences of this option as there are files in the set.--sub-filesetFILE β get the names of the files to operate upon from FILE. that file needs one file name per line. this one's a lifesaver when u only need to process a set of X out of Y files in the directory. if u specify it, the rest of the files given on the command line are ignored.-e,--extensionEXTENSION β process the files with the 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'smtimeusing theDateTimeOriginaltag value. use--no-mtimeto set it to the current time stamp after processing.--no-renrot,--nochgβ do not rename, rotate, tag and mtime images. it saves files from any changes while still allowing u to do aggregation, contact sheet generation, e.t.c. so useful, so iconic.--use-color,--no-use-colorβ colorize output. π this does NOT work under Windows.--dry-runβ do nothing, only print what would have been done. the vibe check before the real thing.-g,--generate-thumbβ generation and writing of theThumbnailImagetag. the original value of theThumbnailImagetag stays intact β to rewrite it u need to delete it first (look at exiftool examples).--use-ipc,--no-use-ipcβ rotate thumbnails using a pipe, rather than files. this does NOT work under Windows either.-vβ increase debugging level by 1. debugging levels from 1 to 4 are internal levels, and the levels from 5 till 9 are equivalent to levels 1-5 levels ExifTool, with the maximum verbosity for renrot.-?,--helpβ display a short usage summary and exit. π«Ά--versionβ output version information and exit.
β¨ AGGREGATION β¨
--aggr-modeMODE β run the aggregation process in the given MODE. possible values are:none,deltaortemplate.--aggr-deltaNUMBER β aggregation time delta, in seconds. files withDateTimeOriginaland ones of the previous file delta, greater than--aggr-delta, are placed in the directories, with the names constructed by concatenating the value of the--aggr-directoryoption and the directory name counter.--aggr-directoryDIR β aggregation directory name prefix (default isImages), has 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,--aggr-templateTEMPLATE β file name template to use for file aggregation. images are aggregated by date/time patterns. u may use a combination of the%d,%H,%M,%m,%S,%Y, and%ymeta-characters. the template can also be defined in the configuration file (see the Aggregation Template variable). the default is%Y%m%d. for the detailed description, refer to the--name-templateoption. for practical uses, see the "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-sheet,--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-file,--cs-fileFILE β base file name for montage files.--contact-sheet-dir,--cs-dirDIR β temporary directory for montage (created in the begining and deleted at the end of the process).--contact-sheet-thm,--cs-thmβ files for the montage are already thumbnails.
the options below are native ImageMagic montage options β look at the 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. don't get cute with it, bestie.
--contact-sheet-tile,--cs-tileGEOMETRY β tile MxN (IM:-tile).--contact-sheet-title,--cs-titleSTRING β set the title of the contact sheet (IM:-title).--contact-sheet-bg,--cs-bgCOLOR β background color (IM:-background).--contact-sheet-bd,--cs-bdCOLOR β border color (IM:-bordercolor).--contact-sheet-mt,--cs-mtCOLOR β frame color (IM:-mattecolor).--contact-sheet-fn,--cs-fnSTRING β render text with this font (IM:-font).--contact-sheet-fl,--cs-flCOLOR β color to fill the text (IM:-fill).--contact-sheet-lb,--cs-lbSTRING β assign a label to an image (IM:-label).--contact-sheet-fr,--cs-frGEOMETRY β surround image with an ornamental border in N pixels (IM:-frame).--contact-sheet-pntsz,--cs-pntszNUMBER β font point size (IM:-pointsize).--contact-sheet-shadow,--cs-shadowβ set the shadow beneath a tile to simulate depth (IM:-shadow).--contact-sheet-thm-fl,--cs-thm-flCOLOR β color to fill the text in generated thumbnail.--contact-sheet-thm-fn,--cs-thm-fnSTRING β render the generated thumbnail text with this font (IM:-font).--contact-sheet-thm-grfr,--cs-thm-grfrCOLOR β generated thumbnail background gradient COLOR-from.--contact-sheet-thm-grto,--cs-thm-grtoCOLOR β generated thumbnail background gradient COLOR-to.--contact-sheet-thm-text,--cs-thm-textSTRING β generated thumbnail text.--contact-sheet-rank,--cs-rankβ run the 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,--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 theKeywordstag. default is to not. be careful, since with this option enabled, the existing keywords are rewriten. the keywords are taken from the.keywordsfile, or from the file specified with the option--keywords-file.-k,--keywords-fileFILE β 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 the existingKeywordstag list rather than add new values to it. default is not to replace.
π RENAMING (the glow-up section)
-nor--name-templateTEMPLATE β the template renrot uses to build your new file names. You can also stash it in the config file (the variable isName Template). Default is%Y%m%d%H%M%S. For real-world glow-ups, peek at the "TEMPLATE EXAMPLES" section below. β¨
Here's every interpreted sequence, bestie, memorize them like your fave lyrics:
%%β a literal%%#β a literal#%Cβ the numeric part of the original file name. This one exists for cameras that don't hand over aFileNumberEXIF tag (currently literally every make except Canon). Those cameras spit out file names that start with letters and end with digits. No other symbols are allowed in file names except-,.and_.%cβ the ordinal number of the file in the processed file set (also see the--counter-fixed-fieldoption).%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 out for the string"NA").%Mβ minute (00-59).%mβ month (01-12).%nβ previous filename (the one from before renrot started processing).%Oβ base part of the original filename (see%o). In other words, the first part from the beginning up to the last dot character.%oβ the name the file had before it was processed by renrot for the first time. If the file was processed only once, the tagRenRotFileNameOriginalis 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 you're building the name template (see "TEMPLATE EXAMPLES").
β οΈ Be careful, okay? Any binary EXIF (like ThumbnaiImage) can produce totally unexpected results. Not the cute kind of surprise. π
--no-renameβ do not rename files (default is to rename them toYYYYmmddHHMMSS.ext)--counter-fixed-field,--no-counter-fixed-fieldβ set a fixed length for the file counter used in file name templates (see%c). It's enabled by default. Use--no-counter-fixed-fieldto undo its effect.--counter-startNUMBER β initial value for the file counter (default is1)--counter-stepNUMBER β the step you increment the file counter by (default is1)
π ROTATING
-ror--rotate-angleANGLE β define the angle to rotate files and thumbnails. Allowed values for ANGLE are90,180or270. Super useful for files that have noOrientationtag.--rotate-thumbANGLE β rotate only thumbnails. Allowed values for ANGLE are90,180or270degrees. Use this when the files were already rotated but their thumbnails were not (the betrayal π€).--only-orientationβ rotate by changing the value of theOrientationtag; no real rotation gets made. The sequence of values to rotate an image from normal (0 degrees) by 90 degrees clockwise is:0 -> 90 -> 180 -> 270 -> 0. Which means: set theOrientationtag to90cwafter the first rotation, and bump that value by 90 every time the 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.
π« Mirror values? Not today. This option cannot be applied to mirror values of the Orientation tag.
--trim,--no-trimβ pass the-trimoption tojpegtran(1), to trim if needed. By default, trimming is enabled. Use--no-trimto disable it.--no-rotateβ do not rotate images (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-tor--tagTAG β see the section "TAGS" for the detailed description--no-tagsβ no user's 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.
βοΈ 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 .renrot. subdirectory of the current user home directory. An alternate configuration file can also be explicitly given 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 a 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"for 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 descriptionincludeβ 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 writen 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 to set multi-line tags from a file. Its syntax is:
TagFile = TagName [Group]: FILE
Here's the rundown of every tag you can use with the --tag option and the 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. Go off, bestie π
π 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 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 overal 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.
π 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 a wrap, gorgeous π«Ά this page is perl v5.32.0, dated 2021-01-25, filed under RENROT(1p) β now go forth and rename, rotate and tag like the icon you are π
π¦ where this page comes from
- debian bookworm: renrot 1.2.0-1
- ubuntu jammy: renrot 1.2.0-1
- ubuntu noble: renrot 1.2.0-1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms