home bbs files messages ]

Just a sample of the Echomail archive

<< oldest | < older | list | newer > | newest >> ]

 Message 10202 
 nospam@[127.0.0.1] to All 
 Re: Looking for a Ubuntu equivalent of X 
 01 Mar 07 07:52:46 
 
Path: number1.nntp.dca.giganews.com!border1.nntp.dca.giganews.co
!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.pipex.net!
ews.pipex.net.POSTED!not-for-mail
NNTP-Posting-Date: Thu, 01 Mar 2007 06:54:28 -0600
Message-ID: 
Date: Thu, 1 Mar 2007 12:52:45 +0000
From: Chris 
Newsgroups: alt.os.linux.ubuntu
Subject: Re: Looking for a Ubuntu equivalent of XP sending picture by email -
converson script...more
References: 
 
  
 
MIME-Version: 1.0
Content-Type: text/plain;charset=us-ascii;format=flowed
User-Agent: Turnpike/6.05-U ()
Lines: 87
NNTP-Posting-Host: 81.86.130.134
X-Trace: sv3-I0Rj7LWM5eB3Pw2pSdZ3sf0mw9adj3REnOmt9X3twHeXocArxQ8
qSZs0Wkydlg1+z+xd/k8WoM8oZq!6bYc7giTSR/XOJmJH6spRIiNaFogH2SAjyOW
/TKt9kolKiU+h4L7MrfDj9Lb3fkQORFyAphSJtE!eTQ6Bw==
X-Complaints-To: abuse@dsl.pipex.net
X-DMCA-Complaints-To: abuse@dsl.pipex.net
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint
properly
X-Postfilter: 1.3.34
Xref: number1.nntp.dca.giganews.com alt.os.linux.ubuntu:11244

In article , Frank 
 writes
>On Thu, 01 Mar 2007 01:17:49 +0000, Frank wrote:
>
>> On Wed, 28 Feb 2007 09:43:36 +0000, Chris wrote:
>>
>
>
>
>>> Hmmm ... someone competent, like you, probably could do that.
>>> And I envy you.  I wish I could.
>>> That does sound the absolutely best solution.
>>> I wonder if enough people would find it useful for someone like you to
>>> be kind enough to publish such a script?
>>
>> Hey Chris,
>>
>> Here's a script -
>>
>> for f in *.[jJ][pP]*[gG]
>> do convert -scale 640x480 $f ${f%%.[jJ][pP]*[gG]}_sm.jpg
>> done
>>
>> just drop it into a file (e-mail_format_picture or
>> whatever) using any editor,
>>
>> chmod 755 that file so it can be executed
>> directly,
>>
>> place it in any /bin directory that's in your path (/bin
>> /usr/bin /usr/local/bin /opt/bin whatever)
>>
>> and whenever you execute it in a directory where your JPEG images for
>> mailing are located will scale all named jpg or JPG or jpeg or JPEG to no
>> greater than 640 height and 480 width, renaming them whatever they were to
>> start ending in _sm.jpg indicating small and ready to mail.
>>
>> You could add an additional piece of code to wrap this in a mailing
>> command but that's overkill.  Again, ImageMagick has to be on your system
>> since that's where the convert function comes from.
>>
>> Frank
>
>Sorry for the follow up, but as I was ready to move on to the next group I
>caught your comment about "I wish I could" and realized I missed an
>opportunity to explain in a simple context something that may advance your
>understanding a bit:
>
>The BASH script structure for...do...done is called a "for loop" which
>executes over and over until a test is done or fails.  In this simple
>script the for just looks at each file that matches the example in the
>directory where it's executed and loads them one at a time into the
>variable f.
>
>for f in *.[gobbledegook...  with that gobbledegook being first a wild
>card * that can be a picture file named anything, then the . that comes
>before the file extension, and finally the valid extension which can
>appear as upper or lower case j [jJ] etc. with another wild card in case
>there's a e or and E (jpeg is spelled out)
>
>do convert -scale 640x480 $f the command to limit the height and width to
>that geometry of each file named whatever is stored in f (read by $f)as
>input file
>
>all that jazz that follows as the output file is just the substitution
>operation where a name ($) is constructed from what's in the curly braces,
>taking the name portion of the file without any extension {f%%. along with
>its dot, and possessing but not using all that same lower/upper case stuff
>in square brackets and replacing } that stuff with the _sm.jpg
>
>rinse, repeat... until all files fitting that description in the directory
>have been converted, at which time the script is ...
>done
>
>Note, the original files aren't altered in any way by this script.
>They'll still be there named the same thing, but along with them will be
>all the _sm.jpg versions ready for attachment.
>
>Frank

Frank - Thanks very much indeed - for the trouble you took.
Much appreciated.
I am now going to go very quiet while I try it all out and cope with all 
the nested problems that are sure to arise during the messy and yet 
delightful process of learning!
-- 
Chris
--- Platinum Xpress/Win/WINServer v3.0pr5
 * Origin: Omicron Theta BBS (1:261/20)

<< oldest | < older | list | newer > | newest >> ]

(c) 1994,  bbs@darkrealms.ca