[28462] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 9826 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Oct 10 00:05:46 2006

Date: Mon, 9 Oct 2006 21:05:06 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Mon, 9 Oct 2006     Volume: 10 Number: 9826

Today's topics:
    Re: Data Extraction Hierarchial Report <bradbrockman@yahoo.com>
    Re: Data Extraction Hierarchial Report <someone@example.com>
    Re: Data Extraction Hierarchial Report <bradbrockman@yahoo.com>
        Firefox Won't Execute My Perl Script steve.ziring@gmail.com
        Firefox Won't Execute My Perl Script steve.ziring@gmail.com
    Re: Firefox Won't Execute My Perl Script <simon.chao@gmail.com>
    Re: Firefox Won't Execute My Perl Script <mgarrish@gmail.com>
    Re: Firefox Won't Execute My Perl Script <sbryce@scottbryce.com>
    Re: Firefox Won't Execute My Perl Script <jurgenex@hotmail.com>
    Re: Output of Concise <benmorrow@tiscali.co.uk>
    Re: Perl ActiveX: A VBA string passed to my control is  david.f.jenkins@usa.net
    Re: Perl ActiveX: A VBA string passed to my control is  <rvtol+news@isolution.nl>
    Re: Perl ActiveX: A VBA string passed to my control is  robic0
    Re: Perl ActiveX: A VBA string passed to my control is  robic0
    Re: Perl ActiveX: A VBA string passed to my control is  (reading news)
    Re: Posting Guidelines for comp.lang.perl.misc ($Revisi usenet@DavidFilmer.com
        question about using jpegtran for lossless compression  ewaguespack@gmail.com
    Re: question about using jpegtran for lossless compress usenet@DavidFilmer.com
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: 9 Oct 2006 17:20:56 -0700
From: "banker123" <bradbrockman@yahoo.com>
Subject: Re: Data Extraction Hierarchial Report
Message-Id: <1160439656.272922.231200@m73g2000cwd.googlegroups.com>

Can you explain so I can learn (expressions) from the code you have
supplied?

John W. Krahn wrote:
> banker123 wrote:
> >
> > John W. Krahn wrote:
> >>
> >>You want something like (UNTESTED):
> >>
> >>#!/usr/bin/perl
> >>use warnings;
> >>use strict;
> >>
> >>my $file = 'C:/data.txt';
> >>
> >>open my $fh, '<', $file or die "Cannot open $file: $!";
> >>
> >>my $account;
> >>while ( <$fh> ) {
> >>    if ( /\A\d/ ) {
> >>        ( $account = $_ ) =~ s/\s+\z//;
> >>        }
> >>    elsif ( s/\A\s+// ) {
> >>        print "$account $_";
> >>        }
> >>    }
> >>
> >>__END__
> >
> > John, this worked can you explain the expressions used to extract the
> > data?
>
> Yes I can.
>
>
>
> John
> --
> Perl isn't a toolbox, but a small machine shop where you can special-order
> certain sorts of tools at low cost and in short order.       -- Larry Wall



------------------------------

Date: Tue, 10 Oct 2006 00:33:04 GMT
From: "John W. Krahn" <someone@example.com>
Subject: Re: Data Extraction Hierarchial Report
Message-Id: <4TBWg.16411$N4.4665@clgrps12>

banker123 wrote:
> 
>>>John W. Krahn wrote:
>>>>You want something like (UNTESTED):
>>>>
>>>>#!/usr/bin/perl
>>>>use warnings;
>>>>use strict;
>>>>
>>>>my $file = 'C:/data.txt';
>>>>
>>>>open my $fh, '<', $file or die "Cannot open $file: $!";
>>>>
>>>>my $account;
>>>>while ( <$fh> ) {
>>>>   if ( /\A\d/ ) {
>>>>       ( $account = $_ ) =~ s/\s+\z//;
>>>>       }
>>>>   elsif ( s/\A\s+// ) {
>>>>       print "$account $_";
>>>>       }
>>>>   }
>>>>
>>>>__END__
> 
> Can you explain so I can learn (expressions) from the code you have
> supplied?

Your file has two types of records, those that begin with digits and those
that begin with whitespace.  The if block matches records that begin with
digits and copies that record to the $account variable and then modifies
$account by removing all trailing whitespace.  The elsif block matches records
that begin with whitespace and removes that whitespace and then prints that
record appended to the $account variable.



John
-- 
Perl isn't a toolbox, but a small machine shop where you can special-order
certain sorts of tools at low cost and in short order.       -- Larry Wall


------------------------------

Date: 9 Oct 2006 17:41:10 -0700
From: "banker123" <bradbrockman@yahoo.com>
Subject: Re: Data Extraction Hierarchial Report
Message-Id: <1160440870.542903.99520@m7g2000cwm.googlegroups.com>

Thanks very helpful.

John W. Krahn wrote:
> banker123 wrote:
> >
> >>>John W. Krahn wrote:
> >>>>You want something like (UNTESTED):
> >>>>
> >>>>#!/usr/bin/perl
> >>>>use warnings;
> >>>>use strict;
> >>>>
> >>>>my $file = 'C:/data.txt';
> >>>>
> >>>>open my $fh, '<', $file or die "Cannot open $file: $!";
> >>>>
> >>>>my $account;
> >>>>while ( <$fh> ) {
> >>>>   if ( /\A\d/ ) {
> >>>>       ( $account = $_ ) =~ s/\s+\z//;
> >>>>       }
> >>>>   elsif ( s/\A\s+// ) {
> >>>>       print "$account $_";
> >>>>       }
> >>>>   }
> >>>>
> >>>>__END__
> >
> > Can you explain so I can learn (expressions) from the code you have
> > supplied?
>
> Your file has two types of records, those that begin with digits and those
> that begin with whitespace.  The if block matches records that begin with
> digits and copies that record to the $account variable and then modifies
> $account by removing all trailing whitespace.  The elsif block matches records
> that begin with whitespace and removes that whitespace and then prints that
> record appended to the $account variable.
>
>
>
> John
> --
> Perl isn't a toolbox, but a small machine shop where you can special-order
> certain sorts of tools at low cost and in short order.       -- Larry Wall



------------------------------

Date: 9 Oct 2006 18:07:51 -0700
From: steve.ziring@gmail.com
Subject: Firefox Won't Execute My Perl Script
Message-Id: <1160442471.860967.165130@m7g2000cwm.googlegroups.com>

I have a perl script that executes successfully in MSIE, but Firefox
prompts me to open or save the same file.  I can not get the Perl file
to execute in Firefox.

I've seen a lot of posts with the same problem except I haven't anybody
that can get the script to execute in one browser but not the other.

Help.



------------------------------

Date: 9 Oct 2006 18:07:55 -0700
From: steve.ziring@gmail.com
Subject: Firefox Won't Execute My Perl Script
Message-Id: <1160442475.548217.96300@k70g2000cwa.googlegroups.com>

I have a perl script that executes successfully in MSIE, but Firefox
prompts me to open or save the same file.  I can not get the Perl file
to execute in Firefox.

I've seen a lot of posts with the same problem except I haven't anybody
that can get the script to execute in one browser but not the other.

Help.



------------------------------

Date: 9 Oct 2006 18:46:38 -0700
From: "it_says_BALLS_on_your_forehead" <simon.chao@gmail.com>
Subject: Re: Firefox Won't Execute My Perl Script
Message-Id: <1160444798.045882.36250@b28g2000cwb.googlegroups.com>


steve.ziring@gmail.com wrote:
> I have a perl script that executes successfully in MSIE, but Firefox
> prompts me to open or save the same file.  I can not get the Perl file
> to execute in Firefox.
>
> I've seen a lot of posts with the same problem except I haven't anybody
> that can get the script to execute in one browser but not the other.
>
> Help.

in the very beginning of the script, try this:

print "Content-type: text/html\n\n";



------------------------------

Date: 9 Oct 2006 18:51:33 -0700
From: "Matt Garrish" <mgarrish@gmail.com>
Subject: Re: Firefox Won't Execute My Perl Script
Message-Id: <1160445093.747193.46180@b28g2000cwb.googlegroups.com>


steve.ziring@gmail.com wrote:

> I have a perl script that executes successfully in MSIE, but Firefox
> prompts me to open or save the same file.  I can not get the Perl file
> to execute in Firefox.
>
> I've seen a lot of posts with the same problem except I haven't anybody
> that can get the script to execute in one browser but not the other.
>

Your terminology is a bit off. Browsers don't execute scripts. Browsers
make requests to resources on servers, which may happen to be perl
scripts, and display the content they get back, or, in your case,
prompt you to download and save.

You haven't provided anything useful that anyone could use to help you
diagnose your problem, though. I imagine if you're getting the expected
behaviour in one browser and not the other then there's probably
something wrong with the headers that you're sending (IE tends to
interpret content however it feels fit, whereas Firefox obeys the
rules).

If you could provide the shortest possible script that others can run
to reproduce the problem you're likely to get more help.

Matt



------------------------------

Date: Mon, 09 Oct 2006 19:59:45 -0600
From: Scott Bryce <sbryce@scottbryce.com>
Subject: Re: Firefox Won't Execute My Perl Script
Message-Id: <9_KdnRtb4YEMY7fYnZ2dnUVZ_rWdnZ2d@comcast.com>

steve.ziring@gmail.com wrote:

> I have a perl script that executes successfully in MSIE, but Firefox 
> prompts me to open or save the same file.  I can not get the Perl
> file to execute in Firefox.

I will assume that you are attempting to run a Perl CGI script.

A CGI script, whether written in Perl or any other language, does not 
run in the browser. It runs on a web server. Your problem appears to be 
a web server configuration problem, not a Perl problem.

You might have more success if you ask your question at 
comp.infosystems.www.authoring.cgi. That is a self-moderated newsgroup. 
When you make your first post, you will be emailed a list of CGI 
resources on the web. You will probably find the answer to your question 
by reading those those resources. Otherwise, try to give as much 
information as you can about your script/configuration, etc. when you 
post there.


------------------------------

Date: Tue, 10 Oct 2006 03:25:04 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Firefox Won't Execute My Perl Script
Message-Id: <koEWg.1848$lj2.661@trndny01>

steve.ziring@gmail.com wrote:
> I have a perl script that executes successfully in MSIE,

I highly doubt that unless you are talking about Perlscript, a language that 
is _VERY_ rarely used.

jue 




------------------------------

Date: Mon, 9 Oct 2006 21:58:07 +0100
From: Ben Morrow <benmorrow@tiscali.co.uk>
Subject: Re: Output of Concise
Message-Id: <vnpqv3-uqa.ln1@osiris.mauzo.dyndns.org>


Quoth "Ferry Bolhar" <bol@adv.magwien.gv.at>:
> J. Gleixner:
> 
> > The documentation for B::Concise seems to explain the output pretty well.
> 
> No, it doesn't. It just mentions somewhat about "targets in brackets".
> 
> But it doesn't explain what these targets are and what the numbers
> indicate.
> 
> Information is useless if one doesn't know what it means.

Have you read perlapi? I admit that it is not clear, and that reading
pp.h/op.h/pp*.c is probably necessary to understand it; but you are
playing with advanced stuff here. You are expected to read and
understand the source.

Most ops have a target. This is a SV allocated in the lexical pad for
that op, and, unless the op has the OPf_STACKED flag, it is used to
avoid allocating a new SV for the op's return value. Instead, the TARG
is filled in with the required value, and a pointer to it pushed onto
the stack.

The [t4] in the output of B::Concise says that this op has op_targ = 4,
which means that the TARG of this op is the fifth entry in the current
sub's lexical pad.

Now *please* start making an effort to work these things out for
yourself, instead of expecting us to hand-feed you.

Ben

-- 
It will be seen that the Erwhonians are a meek and long-suffering people,
easily led by the nose, and quick to offer up common sense at the shrine of
logic, when a philosopher convinces them that their institutions are not based 
on the strictest morality. [Samuel Butler, paraphrased] benmorrow@tiscali.co.uk


------------------------------

Date: 9 Oct 2006 16:29:02 -0700
From: david.f.jenkins@usa.net
Subject: Re: Perl ActiveX: A VBA string passed to my control is treated as a doubel-quoted string
Message-Id: <1160436542.129526.91110@i3g2000cwc.googlegroups.com>


david.f.jenkins@usa.net wrote:
> Hi: I'm very new at all things Perl, so I may have my terminology
> boogered up.  Here goes:
>
> I have written a Perl ActiveX control that's suppose to do some regular
> expression operations on data and patterns sent from VBA (as VT_BSTR).
> Everything seems to be working ok, except that it appears the pattern
> arguments to Perl are being treated as double-quoted strings.
>
> Here is a string I'm passing in from VBA (and also using when testing
> using a Perl call):
>
> "(\s)(-{1,2}|-)(\s)" (the character after the vertical bar is an en
> dash.)
>
> When I use this string in VBA, I get erroneous resutls from my control.
> If I write a call in Perl, using the same arguments as I use in VBA, I
> also get erroneous results.  However, if I change the Perl argument
> string to a single-quoted string, then I get correct results.  Alos, if
> I change the \s's to blanks and use double quotes, it works ok.  If I
> leave the \s's in and use single-quotes, it works ok.  But as is -
> unh-unh.
>
> Do I have interpolative context problems?  The larger question I have,
> is how can I coerce the control to treat the string that's being passed
> in as single-quoted string?  Or is there perhaps some easier solution?

I found this in a post to this group from 1996 - it pretty much sums up
my problem, I think:

"If a variable [function argument, in my case]  has a string which will
be interpreted as a double-quoted string, is there a way to cause the
variable to be interpreted as a single-quoted string? 
"



------------------------------

Date: Tue, 10 Oct 2006 03:10:45 +0200
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: Perl ActiveX: A VBA string passed to my control is treated as a doubel-quoted string
Message-Id: <egf35s.1fs.1@news.isolution.nl>

david.f.jenkins@usa.net schreef:

> I have written a Perl ActiveX control that's suppose to do some
> regular expression operations on data and patterns sent from VBA (as
> VT_BSTR). Everything seems to be working ok, except that it appears
> the pattern arguments to Perl are being treated as double-quoted
> strings.

Again a broad question without the short-but-complete example that shows
your problem and that we can run. Why do you insist on that ineffective
way? Have you read the Posting Guidelines? Read them again.

Make the simplest "Perl ActiveX Control" that only prints out the value
and does nothing else, and work from there. If the problem still
appears, come back here with that code.

There are ways to "protect" special characters in a string against
interpolation, like quotemeta(), but you shouldn't use something like
that to "correct" an error that you made earlier.

-- 
Affijn, Ruud

"Gewoon is een tijger."




------------------------------

Date: Mon, 09 Oct 2006 18:36:15 -0700
From: robic0
Subject: Re: Perl ActiveX: A VBA string passed to my control is treated as a doubel-quoted string
Message-Id: <dusli210uk9hkqirkmrnnb45vti22a1okq@4ax.com>

On 9 Oct 2006 16:29:02 -0700, david.f.jenkins@usa.net wrote:

>
>david.f.jenkins@usa.net wrote:
>> Hi: I'm very new at all things Perl, so I may have my terminology
>> boogered up.  Here goes:
>>
>> I have written a Perl ActiveX control that's suppose to do some regular
>> expression operations on data and patterns sent from VBA (as VT_BSTR).
>> Everything seems to be working ok, except that it appears the pattern
>> arguments to Perl are being treated as double-quoted strings.
>>
>> Here is a string I'm passing in from VBA (and also using when testing
>> using a Perl call):
>>
>> "(\s)(-{1,2}|-)(\s)" (the character after the vertical bar is an en
>> dash.)
>>
>> When I use this string in VBA, I get erroneous resutls from my control.
>> If I write a call in Perl, using the same arguments as I use in VBA, I
>> also get erroneous results.  However, if I change the Perl argument
>> string to a single-quoted string, then I get correct results.  Alos, if
>> I change the \s's to blanks and use double quotes, it works ok.  If I
>> leave the \s's in and use single-quotes, it works ok.  But as is -
>> unh-unh.
>>
>> Do I have interpolative context problems?  The larger question I have,
>> is how can I coerce the control to treat the string that's being passed
>> in as single-quoted string?  Or is there perhaps some easier solution?
>
>I found this in a post to this group from 1996 - it pretty much sums up
>my problem, I think:
>
>"If a variable [function argument, in my case]  has a string which will
>be interpreted as a double-quoted string, is there a way to cause the
>variable to be interpreted as a single-quoted string? 
>"

So you are sending a regex string from VB embedded in Power Point to
a ActiveX (com object) control that has an embedded Perl regex lib.

Hmm, interesting. Seems pretty high power stuff for someone who doesen't
know what single/double quoted (in-solution) strings are. 

Perl regex has its own set of escape characters like any other parser.
The reason the single '' quotes worked for you is that '\s' is \s 
in any language. The \ is the universal escape character.

To make '\s' come out the other end of the pipe you have to use "\\s"
double flavor. It then goes into solution as \s. In solution means after
the parser transforms it and its in memory and will never get changed
unless it comes out and posibly goes back in modified.

Perl regex has a further set of escape characters. Using the universal '\'
character you should, on the VBA side, escape all of Perls regex escape
characters.

Below is a sample Perl code to escape all regex from a perl string.
You need to extrapolate this to the VBA side.

Good luck, you seem to be in total misery......
robic0

ps. just escape everything..... literally!

------------------------------------


use strict;
use warnings;

my ($pat_convert);

$pat_convert  = convertPatternMeta ( 'Hello...?' );
showMatchResult ($pat_convert, 'Hello...? this is a big string x');
showMatchResult ($pat_convert, 'Oh Hello x');

$pat_convert  = convertPatternMeta ( '*?+' );
showMatchResult ($pat_convert, 'Hello...? this (*?+) is a big string x');
showMatchResult ($pat_convert, '*?+ and so is this');

## ------------------------------------
## Helpers
##
sub convertPatternMeta
{
    my ($pattern) = shift;
    my @regx_esc_codes =
    (
    "\\", '/', '(', ')', '[', ']', '?', '|',
    '+', '.', '*', '$', '^', '{', '}', '@'
    );
    foreach my $tc (@regx_esc_codes) {
        # code template for regex
        my $xxx = "\$pattern =~ s/\\$tc/\\\\\\$tc/g;";
        eval $xxx;
        if ($@) {
            # the compiler will show the escape char, add
            # it char to @regx_esc_codes
            $@ =~ s/^[\s]+//s; $@ =~ s/[\s]+$//s;
            die "$@";
        }
    }
    return $pattern;
}
##
sub showMatchResult
{
    my ($pattern, $string) = @_;
    my $result_txt = '';
    my ($result) = $string =~ /$pattern/;
    if ($result) { $result_txt = 'DOES match'}
    else { $result_txt = 'Does NOT match' }
    print "\nString:      $string\n$result_txt\nPattern:     $pattern\n";
}



------------------------------

Date: Mon, 09 Oct 2006 19:07:57 -0700
From: robic0
Subject: Re: Perl ActiveX: A VBA string passed to my control is treated as a doubel-quoted string
Message-Id: <d20mi2do5spofj82m993thsni4kql56hp5@4ax.com>

On Tue, 10 Oct 2006 02:05:51 GMT, "Mumia W. (reading news)" <paduille.4059.mumia.w@earthlink.net> wrote:

>>> david.f.jenkins@usa.net wrote:
>>>> Hi: I'm very new at all things Perl, so I may have my terminology
>>>> boogered up.  Here goes:
>>>>
>>>> I have written a Perl ActiveX control that's suppose to do some regular
>>>> expression operations on data and patterns sent from VBA (as VT_BSTR).
>>>> Everything seems to be working ok, except that it appears the pattern
>>>> arguments to Perl are being treated as double-quoted strings.
>>>>
>>>> Here is a string I'm passing in from VBA (and also using when testing
>>>> using a Perl call):
>>>>
>>>> "(\s)(-{1,2}|-)(\s)" (the character after the vertical bar is an en
>>>> dash.)
>>>>
>>>> When I use this string in VBA, I get erroneous resutls from my control.
>>>> If I write a call in Perl, using the same arguments as I use in VBA, I
>>>> also get erroneous results.  However, if I change the Perl argument
>>>> string to a single-quoted string, then I get correct results.  Alos, if
>>>> I change the \s's to blanks and use double quotes, it works ok.  If I
>>>> leave the \s's in and use single-quotes, it works ok.  But as is -
>>>> unh-unh.
>>>>
>>>> Do I have interpolative context problems?  The larger question I have,
>>>> is how can I coerce the control to treat the string that's being passed
>>>> in as single-quoted string?  Or is there perhaps some easier solution?
>
>Try the the quotemeta function on that string.

Hows he gonna use my ripped off code (quotemeta()) on the VBA side?
Dimwit!

robic0


------------------------------

Date: Tue, 10 Oct 2006 02:05:51 GMT
From: "Mumia W. (reading news)" <paduille.4059.mumia.w@earthlink.net>
Subject: Re: Perl ActiveX: A VBA string passed to my control is treated as a doubel-quoted string
Message-Id: <3eDWg.7321$Y24.1507@newsread4.news.pas.earthlink.net>

>> david.f.jenkins@usa.net wrote:
>>> Hi: I'm very new at all things Perl, so I may have my terminology
>>> boogered up.  Here goes:
>>>
>>> I have written a Perl ActiveX control that's suppose to do some regular
>>> expression operations on data and patterns sent from VBA (as VT_BSTR).
>>> Everything seems to be working ok, except that it appears the pattern
>>> arguments to Perl are being treated as double-quoted strings.
>>>
>>> Here is a string I'm passing in from VBA (and also using when testing
>>> using a Perl call):
>>>
>>> "(\s)(-{1,2}|-)(\s)" (the character after the vertical bar is an en
>>> dash.)
>>>
>>> When I use this string in VBA, I get erroneous resutls from my control.
>>> If I write a call in Perl, using the same arguments as I use in VBA, I
>>> also get erroneous results.  However, if I change the Perl argument
>>> string to a single-quoted string, then I get correct results.  Alos, if
>>> I change the \s's to blanks and use double quotes, it works ok.  If I
>>> leave the \s's in and use single-quotes, it works ok.  But as is -
>>> unh-unh.
>>>
>>> Do I have interpolative context problems?  The larger question I have,
>>> is how can I coerce the control to treat the string that's being passed
>>> in as single-quoted string?  Or is there perhaps some easier solution?

Try the the quotemeta function on that string.

-- 
Mumia W.
paduille.4059.mumia.w@earthlink.net
This is a temporary e-mail to help me catch some s-p*á/m.


------------------------------

Date: 9 Oct 2006 15:47:52 -0700
From: usenet@DavidFilmer.com
Subject: Re: Posting Guidelines for comp.lang.perl.misc ($Revision: 1.6 $)
Message-Id: <1160434072.332012.289090@c28g2000cwb.googlegroups.com>

Matt Garrish wrote:
> Alt.perl was a much happier place for beginners (or so I found some 6
> or so years ago when I first picked up Perl), if not quite as
> technically sound at times (although there were regulars there who
> would correct the more outrageous posts), but somewhere in the last 6
> years traffic there died off almost completely. CLPM is not the place
> to get your feet wet in usenet, but being the only real source for perl
> help you wade in at your peril.

The perl.org "beginners" mailing list
(http://learn.perl.org/beginners-faq) is reflected to usenet and
carried by most nntp servers as perl.beginners.  It's similar to what
alt.perl used to be. Many folks from clpm lurk and post there as well.
That list/group has a far more liberal charter, and (in my experience)
new posters are held to a much lower standard and often get helpful
responses to questions which would likely inspire more hostile
responses in clpm.

--
The best way to get a good answer is to ask a good question.
David Filmer (http://DavidFilmer.com)



------------------------------

Date: 9 Oct 2006 17:10:23 -0700
From: ewaguespack@gmail.com
Subject: question about using jpegtran for lossless compression of jpegs
Message-Id: <1160439023.424857.180230@e3g2000cwe.googlegroups.com>

first of all, sorry for the cross-posting, but I am not sure where to
go for help with this...

I have been using a freeware windows application that strips all non
image info from a jpeg, here are the details:

http://davidcrowell.com/jStrip/Default.aspx
Features

jStrip removes the following from JPEG files:

   * Comments (optionally)
   * EXIF Data (optionally)
   * JFIF Header (optionally)
   * Photoshop Image Resource Block (optionally)
   * ICC color profile
   * Adobe APP14 tag (optionally)
   * XMP data (optionally)
   * Extra bytes at end of file
   * Extra bytes or header at beginning of file
   * Extra bytes between JPEG blocks
   * Application-specific APPx blocks
   * Photoshop thumbnails
   * Any other unknown blocks in the JPEG files

in attempting to come up with a solution that does all of the above in
linux, I have played around with a couple of perl solutions, jhead,
exiftool, and jpegtran.

the best thing I have come up with so far is the following:
#jpegtran -optimize -outfile $image $image

or recursively:
# find -type f -name "*.jpg" -exec jpegtran -optimize -copy none
-outfile {} {} \;

other options I played with were the following:
# exiftool -all= $image
# jhead -purejpg $image

so, anyway to finally get to my point, the jpegtran (Linux) solution
does everything that jstrip (windows) does, (and more: optimize,
progressive) except remove the jfif header

so the question is, how do I remove the jfif header in a scripted,
recursive fashion in Linux.

If I am successful at finding a solution with this, it will finally
allow me to move completely to Linux.

finally, if you know where a forum / mailing list is that would be more
appropriate, please let me know.

Thank you in advance.



------------------------------

Date: 9 Oct 2006 18:23:20 -0700
From: usenet@DavidFilmer.com
Subject: Re: question about using jpegtran for lossless compression of jpegs
Message-Id: <1160443400.781131.302550@b28g2000cwb.googlegroups.com>

ewaguespack@gmail.com wrote:
> so the question is, how do I remove the jfif header in a scripted,
> recursive fashion in Linux.

If you cannot find a binary program that does all you want, you can
write your own little Perl script.  You would recurse the directories
(using File::Find or (my favorite) IO::All) and process each image with
something like Image::MetaData::JPEG.

I don't get the sense that you know Perl.  If you would like to learn
Perl programming (a very useful skill), this would be a good exercise
(it's fairly simple).  Check out http://learn.perl.org.  If you need
help with your program, feel free to ask. You significantly increase
the quality of your responses if you ask according to the posting
guidelines of this particular newsgroup, which you may find here:
   http://www.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html

Good Luck!

-- 
David Filmer (http://DavidFilmer.com)



------------------------------

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc.  For subscription or unsubscription requests, send
#the single line:
#
#	subscribe perl-users
#or:
#	unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.

#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V10 Issue 9826
***************************************


home help back first fref pref prev next nref lref last post