Skip to content

Commit

Permalink
convert to jpg
Browse files Browse the repository at this point in the history
  • Loading branch information
cytopia committed Sep 22, 2013
1 parent e21eeb7 commit e9d4851
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 1 deletion.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ If any of the actions don't work anymore (especially the upload ones), please re
## Multimedia

### ![Thunar Convert to PNG](/icons/thunar-convert-to-png.png) [thunar-convert-to-png.sh](thunar-convert-to-png.sh)
This action converts any image file to a png image.
This action converts any image file to a png image. (Should also work with layered PSD files)

### ![Thunar Convert to JPG](/icons/thunar-convert-to-jpg.png) [thunar-convert-to-jpg.sh](thunar-convert-to-jpg.sh)
This action converts any image file to a jpg image. (Should also work with layered PSD files)


### ![Thunar Media Info](/icons/thunar-media-info.png) [thunar-media-info.sh](thunar-media-info.sh)
Expand Down
Binary file added icons/thunar-convert-to-jpg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
68 changes: 68 additions & 0 deletions thunar-convert-to-jpg.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
#!/bin/sh
#
# Convert an image file to a jpg file.
#
# * Put this file into your home binary dir: ~/bin/
# * Make it executable: chmod +x
#
#
# Required Software:
# -------------------------
# * convert
#
#
# Thunar Integration
# ------------------------
#
# Command: ~/bin/thunar-convert-to-jpg.sh -f %f
# File Pattern: *
# Appear On: Image Files
#
#
# Usage:
# -------------------------
# thunar-convert-to-jpg.sh -f <filename>
#
# required:
# -f input filename
#
# Note:
# -------------------------
#
# Feel free to adjust/improve and commit back to:
# https://github.com/pantu/thunar-custom-actions
#


usage() {
echo "$0 -f <filename>"
echo
echo " required:"
echo " -f input filename"
echo
exit 1
}


while getopts ":f:" i; do
case "${i}" in
f)
f=${OPTARG}
;;
*)
echo "Error - unrecognized option $1" 1>&2;
usage
;;
esac
done
shift $((OPTIND-1))

# Check if file is specified
if [ -z "${f}" ]; then
echo "Error - no file specified" 1>&2;
usage
fi

convert "${f}" "${f}.jpg"

exit 0
Empty file modified thunar-upload-to-imgur.sh
100644 → 100755
Empty file.

0 comments on commit e9d4851

Please sign in to comment.