forked from gioman/gioman_scripts_for_gis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
16b_2_8b_convert_kdialog.sh
executable file
·50 lines (50 loc) · 1.79 KB
/
16b_2_8b_convert_kdialog.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/bash
#
# ***************************************************************************
# Name : 16bit 2 8bit Kdialog
# Description : Convert 16 to 8 bits. Using Kdialog Change original image!
#
# Arguments:
# $1: Image with 16bits
#
# Dependencies : KDE and 16_2_8b_convert.sh
#
# ***************************************************************************
# begin : 2015-04-15 (yyyy-mm-dd)
# copyright : (C) 2015 by Luiz Motta
# email : motta dot luiz at gmail.com
# ***************************************************************************
#
# Revisions
#
# 0000-00-00:
# - None
#
# ***************************************************************************
#
# Example:
# 16b_2_8b_convert_Kdialog.sh
#
# ***************************************************************************
# * *
# * This program is free software; you can redistribute it and/or modify *
# * it under the terms of the GNU General Public License as published by *
# * the Free Software Foundation; either version 2 of the License, or *
# * (at your option) any later version. *
# * *
# ***************************************************************************
#
title="16b_to_8b_convert"
img=$(kdialog --title $title --getopenfilename $HOME "*.* |Images type")
if [ -f "$img" ]
then
kdialog --title $title --passivepopup "Processing:\n$img" 5
if msg=$(16b_2_8b_convert.sh $img)
then
kdialog --title $title --msgbox "Finished.\n$msg"
else
kdialog --title $title --sorry "Error!.\n$msg"
fi
else
kdialog --title $title --passivepopup "Not Select File!" 5
fi