/useful/trunk-1

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/useful/trunk-1

« back to all changes in this revision

Viewing changes to scripts/process_text_to_image.sh

  • Committer: Gustav Hartvigsson
  • Date: 2021-01-13 21:07:32 UTC
  • Revision ID: git-v1:28c2b64490ca54b6152853791a389fdce31e62c5
Added FILE NAME to scripts missing it,
and added FIXME to mp32opus.sh.

Genaral tiying up of desriptor comment

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
# Changes
5
5
#
6
6
# 2018-09-03:
7
 
# added --no-header for when you want to use your own pandoc header
 
7
#   * added --no-header for when you want to use your own pandoc header
8
8
#
9
9
# 2018-09-22
10
 
# Fixed --no-header... Seemed to have forgotten the "$" infront of the variable.
 
10
#   * Fixed --no-header...
 
11
#     Seemed to have forgotten the "$" infront of the variable.
 
12
#
 
13
# 2021-01-13
 
14
#   * fixed up the if statments.
11
15
#
12
16
# ------
13
17
 
100
104
  echo "DPI: $DPI"
101
105
  #echo "ESCAPED_CWD\: $ESCAPED_CWD"
102
106
  
103
 
  if [ ! -e "$CWD/$IN_FILE" ]
 
107
  if [[ ! -e "$CWD/$IN_FILE" ]]
104
108
  then
105
109
    echo "!!!in file does not exist!!!"
106
110
    echo ""
116
120
  cd "$CWD/tmp"
117
121
  
118
122
  # Now we can start the work for this.
119
 
  if [ $_NO_PANDOC_HEADER = false ]
 
123
  if [[ $_NO_PANDOC_HEADER == false ]]
120
124
  then
121
125
    # We add a special header to the file to make it pandoc know what to do.
122
126
    
145
149
  FINAL_IMAGE=""
146
150
  
147
151
  # If we invert the final image this is where we do it.
148
 
  if [ $INVERT_COLOURS = true ]
 
152
  if [[ $INVERT_COLOURS == true ]]
149
153
  then
150
154
    convert "$CWD/tmp/big-page.png" -channel RGB -negate "$CWD/tmp/big-page-inverted.png"
151
155
    FINAL_IMAGE="$CWD/tmp/big-page-inverted.png"
158
162
 
159
163
 
160
164
parse_args() {
161
 
  if [ -z "$1" ]
 
165
  if [[ -z "$1" ]]
162
166
  then
163
167
    echo "Try --help or -h."
164
168
    exit 1
167
171
  
168
172
  while [[ $# -gt 0 ]]
169
173
  do
170
 
    eval key="${1}"
171
174
    
172
175
    case "${1}" in
173
176
      -i|--input)
223
226
parse_args "${@}"
224
227
main
225
228
 
226
 
if [ $PERSERVE_TMP = true ]
 
229
if [[ $PERSERVE_TMP = true ]]
227
230
then
228
231
  echo "Not cleaning up!"
229
232
else