rubo77

shutter OptiPNG PNG optimizer plugin

Aug 16th, 2013
312
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.92 KB | None | 0 0
  1. #! /usr/bin/env bash
  2.  
  3. ###################################################
  4. #
  5. #  Copyright (C) 2008, 2009, 2010 Mario Kemper <[email protected]> and Shutter Team
  6. #
  7. #  This file is part of Shutter.
  8. #
  9. #  Shutter is free software; you can redistribute it and/or modify
  10. #  it under the terms of the GNU General Public License as published by
  11. #  the Free Software Foundation; either version 3 of the License, or
  12. #  (at your option) any later version.
  13. #
  14. #  Shutter is distributed in the hope that it will be useful,
  15. #  but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  17. #  GNU General Public License for more details.
  18. #
  19. #  You should have received a copy of the GNU General Public License
  20. #  along with Shutter; if not, write to the Free Software
  21. #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  22. #
  23. ###################################################
  24. #
  25. #  OptiPNG Plugin by Roman Raguet http://askubuntu.com/a/329830/34298
  26. #
  27. #  recompresses png image files to a smaller size
  28. #
  29. ###################################################
  30.  
  31. TEXTDOMAIN=shutter-plugins
  32. TEXTDOMAINDIR=$SHUTTER_INTL
  33. PLUGIN_NAME=$"Optipng Plugin"
  34. PLUGIN_SORT=$"Recompress"
  35. PLUGIN_TIP=$"OptiPNG is a PNG optimizer that recompresses image files to a smaller size"
  36. PLUGIN_EXT="image/png"
  37. #LOGO="/usr/share/shutter/resources/system/plugins/shell/optipngplugin/optipngplugin.png"
  38. if [[ "${1}" = "name" ]];then
  39.     echo "${PLUGIN_NAME}"
  40.     exit 0
  41. elif [[ "${1}" = "sort" ]];then
  42.     echo "${PLUGIN_SORT}"
  43.     exit 0
  44. elif [[ "${1}" = "tip" ]];then
  45.     echo "${PLUGIN_TIP}"
  46.     exit 0
  47. elif [[ "${1}" = "ext" ]];then
  48.     echo "${PLUGIN_EXT}"
  49.     exit 0
  50. fi
  51. FILE="${1}"
  52. #WIDTH="${2}"
  53. #HEIGHT="${3}"
  54. #FILEYTPE="${4}"
  55. #INTL_PATH="${5}"
  56. #GEO="${2}x${3}"
  57.  
  58. # option -o7 is the best compression but takes quite long:
  59. optipng -o7 "${FILE}"
  60. exit 0
Advertisement
Add Comment
Please, Sign In to add comment