IgnorantGuru's Blog

Linux software, news, and tips

Script: repic


Download Links:
Script: downloadbrowseauthenticateinstructions
Debian/Ubuntu: packagesPPA
Arch Linux: AUR
Description: Resizes and rotates JPEGs; creates Claws and Kmail email with pics attached
Recommended For: Linux
Requires: imagemagick jhead zenity
License: GNU GPL v3     * SEE DISCLAIMER *
Related: pcmanfm-mod scanpic webpics
Feedback: commentsissues


repic resizes one or more JPEG files on the command line, and can also create an email message in Claws or KMail with the resized images attached. By default, the original file will be retained and a new file will be created.

repic --help

Resizes JPEG file(s) if larger than size; rotates original if needed
Optional: Creates email message with pics attached (Claws and KMail)
Requires: imagemagick jhead zenity
Usage: repic [OPTIONS] JPEGFILE ...
--size ###x###        maximum HxV dims [default 1280x1024]
--quality ##          jpeg quality [default 85]
--replace             overwrite original files
--remove              remove original files
--norotate            do not auto-rotate originals
--rotateonly          auto-rotate originals only, no resize
--tmp                 Move resized file(s) to /tmp
--email               Create an email message [default 1024x768]
--intersize           toggle interactive size dialog
--interquality        toggle interactive quality dialog
--interopt            toggle interactive options dialog
--verbose             detailed feedback


# To resize an entire folder of pics to 800x600:
repic --size 800x600 /mypicsfolder/*.jpg

# To resize a pic to 1024x768 and attach it to an email:
repic --email example.jpg

Note that by default this script may alter the original file by rotating it if needed. If you don’t want it to do so, use the ––norotate option.)

The inter… options will cause a dialog to appear, allowing you to specify image size, quality, and options. This is handy when integrated with a file manager, allowing you open selected files with repic and then choose what you want done. (This functionality requires Zenity to be installed.)


Installation Instructions

Follow the standard Script Installation Instructions. Alternatively, for Debian and Ubuntu a deb package and a PPA repository are available. On Arch Linux, repic can be installed automatically using the AUR.

Before running repic, install required packages using your package manager. For example, on Debian/Ubuntu:

apt-get install imagemagick jhead zenity

The top of the script contains a User Defaults section where you can set various options to the defaults you want – edit the script to adjust these.


  1. Zenity is so last year! How do I use this with Yad?

    Comment by Moi | September 26, 2012 | Reply

    • I don’t use yad so you’ll have to convert that yourself. I also recommend checking out the new SpaceFM Dialog, which is similar to yad, zenity, etc.

      Comment by IgnorantGuru | September 26, 2012 | Reply

Leave a Comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: