07-20-2009
Imagemagick File Padding Issue
Hello, I'm having a problem figuring out the syntax for padding 10-99. Everything else in the program works fine so I want to focus in on just this part of the code. Below is a snippet of the code that I am having problems with. I appreciate all the help I can get. Thank you.
The script basically takes an image and adds the convert charcoal filter and spits out a sequence the user specifies. Problem is if the frame goes over 100...the padding is thrown off since 100 is set for greater than or equal to, where 10-99 needs to be specified to a limit before 100.
I seen a for loop where it prints like so..
for i in {10..99} etc... but that will not work, it only prints and {10..99} does not work for an if statement.
##no problem here
if [ $count -lt 10 ]; then
convert ${IMGDIR}${IMG} -charcoal $count ${OUTDIR}${OUT}.000$count.jpg
fi
##cant figure out the arithmatic here!
if ( $count -ge 10 > 99 ); then
convert ${IMGDIR}${IMG} -charcoal $count ${OUTDIR}${OUT}.00$count.jpg
fi
##no problems here.
if [ $count -ge 100 ] ; then
convert ${IMGDIR}${IMG} -charcoal $count ${OUTDIR}${OUT}.0$count.jpg
fi
7 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi
I am planning to install ImageMagick on my server here. I have learned what I needed about Unix when I needed it..... but I have never installed anything before.
I have downloaded the necessary file from imagemagick.org, and their installation instructions seem easy enough (only 2 or 3... (2 Replies)
Discussion started by: bob2003
2 Replies
2. HP-UX
Hi Gurus,
There is a ASCII file in which a comma is used as a seperator for the amount field when the amount exceed seven digits: e.g. 0001300,000. Now, this comma needs to be removed from this field, after padding leading zeros (to maintain the ASCII positions) e.g. 00001300000.... (1 Reply)
Discussion started by: pranag21
1 Replies
3. UNIX for Advanced & Expert Users
Hi All,
I am getting a xml file where the first field contains a carriage return and the all other fields doesnot contains any carriage return. So all the other records comes in the second line.
<?xml version="1.0" encoding="UTF-8"?>
<ns0:iSeriesCspIntegration... (3 Replies)
Discussion started by: dasj22
3 Replies
4. UNIX and Linux Applications
i am struggling to find an error free, and complete install package for ImageMagick (with perl- "PerlMagick"). imagemagick.org not much help.... links for source, mirrors etc dont work. any pointers appreciated.
linux server. (2 Replies)
Discussion started by: mickeymouse
2 Replies
5. Shell Programming and Scripting
Hi all,
I have a FreeNAS server hosting all of my images. The original images are high resolution. What I would like to do is 2 parts:
1. do a batch resize of all of the images so I have web-friendly version and print ready version
2. run a cron job to apply the bash to any "new" files
... (1 Reply)
Discussion started by: Imhotep1963
1 Replies
6. Shell Programming and Scripting
Hi Guys,
I have a file as shown below:
55
6
77
8
88
98
7
85
45
544
1
33
32
13
13 (5 Replies)
Discussion started by: npatwardhan
5 Replies
7. Shell Programming and Scripting
Hi,
I have a fixed length text file that needs to be cut into individual files in aix and facing padding issues. If I have multiple blank spaces in the file it is just making it one while cutting the files..
Eg:-
$ - blank space
filename:file.txt
... (2 Replies)
Discussion started by: techmoris
2 Replies
LEARN ABOUT CENTOS
tk_focusnext
tk_focusNext(n) Tk Built-In Commands tk_focusNext(n)
__________________________________________________________________________________________________________________________________________________
NAME
tk_focusNext, tk_focusPrev, tk_focusFollowsMouse - Utility procedures for managing the input focus.
SYNOPSIS
tk_focusNext window
tk_focusPrev window
tk_focusFollowsMouse
_________________________________________________________________
DESCRIPTION
tk_focusNext is a utility procedure used for keyboard traversal. It returns the "next" window after window in focus order. The focus order
is determined by the stacking order of windows and the structure of the window hierarchy. Among siblings, the focus order is the same as
the stacking order, with the lowest window being first. If a window has children, the window is visited first, followed by its children
(recursively), followed by its next sibling. Top-level windows other than window are skipped, so that tk_focusNext never returns a window
in a different top-level from window.
After computing the next window, tk_focusNext examines the window's -takefocus option to see whether it should be skipped. If so,
tk_focusNext continues on to the next window in the focus order, until it eventually finds a window that will accept the focus or returns
back to window.
tk_focusPrev is similar to tk_focusNext except that it returns the window just before window in the focus order.
tk_focusFollowsMouse changes the focus model for the application to an implicit one where the window under the mouse gets the focus. After
this procedure is called, whenever the mouse enters a window Tk will automatically give it the input focus. The focus command may be used
to move the focus to a window other than the one under the mouse, but as soon as the mouse moves into a new window the focus will jump to
that window. Note: at present there is no built-in support for returning the application to an explicit focus model; to do this you will
have to write a script that deletes the bindings created by tk_focusFollowsMouse.
KEYWORDS
focus, keyboard traversal, top-level
Tk 4.0 tk_focusNext(n)