Replacement for nautilus-image-converter

Hello,

d oes anyone know a good replacement tool for nautilus-image-converter? (nautilus-image-converter - Fedora Packages)

I use it quite frequently and with the upcoming upgrade of my machine from F36 to F37 it will go away. Sad, but that’s what it is…

Thanks.

3 Likes

Since it uses ImageMagick under the hood, you can still use it from the command line if the GUI is not required.

2 Likes

You can search on the Internet or create your own Nautilus scripts and extensions:

Here I’ve coded a simple script:

sudo dnf install bash ImageMagick zenity

mkdir -p ~/.local/share/nautilus/scripts
tee ~/.local/share/nautilus/scripts/image-converter.sh << "EOF" > /dev/null
#!/usr/bin/bash

# Coded by: Vladislav Grigoryev <vg[dot]aetera[at]gmail[dot]com>
# License: GNU General Public License (GPL) version 3+
# Description: Resize images with ImageMagick from Nautilus
# Requires: bash coreutils ImageMagick nautilus zenity

script_init() {
	IFS="|" read -r IMG_SIZE IMG_WSIZE IMG_HSIZE IMG_OUT < <(zenity \
		--forms \
		--title="Image converter" \
		--text="$(wc -l \
			<<< "${IMG_PATH}") files selected" \
		--ok-label="Resize" \
		--add-combo="Size" \
		--combo-values="$(tr " " "|" \
			<<< "${IMG_SIZE[@]}")" \
		--add-entry="Width" \
		--add-entry="Height" \
		--add-list="Output" \
		--list-values="copy / default|replace")
}

script_exec() {
	if [ -n "${IMG_WSIZE}" ] || [ -n "${IMG_HSIZE}" ]
	then IMG_SIZE="${IMG_WSIZE}x${IMG_HSIZE}"
	fi
	if [ -z "${IMG_SIZE/ /}" ]
	then IMG_SIZE="${IMG_DSIZE}x${IMG_DSIZE}"
	fi
	while read -r IMG_PATH
	do
		IMG_OPATH="${IMG_PATH%/*}/resized.${IMG_PATH##*/}"
		convert "${IMG_PATH}" -resize "${IMG_SIZE}" "${IMG_OPATH}"
		if [ "${IMG_OUT}" = "replace" ]
		then mv -f "${IMG_OPATH}" "${IMG_PATH}"
		fi
	done <<< "${IMG_PATH}" | zenity \
		--progress \
		--pulsate \
		--auto-close \
		--no-cancel \
		--title="Image converter" \
		--text="Processing files..."
}

IMG_PATH="${NAUTILUS_SCRIPT_SELECTED_FILE_PATHS/%$'\n'/}"
IMG_DSIZE="1024"
IMG_SIZE=(
	640x480 800x600 1024x768 1280x720 1366x768
	1440x900 1600x1200 1920x1080 2560x1440 3840x2160
)

if script_init
then script_exec
fi

exit 0
EOF
chmod +x ~/.local/share/nautilus/scripts/image-converter.sh

See also:

5 Likes

Is nautilus-image-converter really gone forever? It was such an easy way to quickly resize an image.

2 Likes

Thank you!

1 Like

The package in Fedora is orphaned and the original upstream project is dead. However, a maintained fork exists: Corey Berla / nautilus-image-converter · GitLab
So there is no reason someone couldn’t pick up that fork and package it for Fedora again.

1 Like

Thanks @heffer. I’m a retired dev on a completely different platform, but maybe I’ll learn how to package RPMs.