[Thamesvalley-pm] MIME:Parser
Andrew
thamesvalley-pm at unitedgames.co.uk
Thu Aug 18 07:45:31 PDT 2016
Was so busy coding at the time, I never did get round to saying thanks for
the reply Roger!
I ended up doing this:
https://www.youtube.com/watch?v=GFrpfAUMXyg
...and I'm sure there are security holes all over it, ^_^,
...and while I love making Windows 3.1 word processors such as Ami Pro,
relevant to a 2016 web workflow,
another friend pointed out IDML to me...Adobe's open document for InDesign.
So perhaps I could do something similar to create InDesign documents?
Although first I'll have to upgrade from CS3, to something CS4 or higher....
(CS4 is what first supported IDML).
I haven't tried out all the CPAN modules you mentioned - what I had seemed
to work.
ImageMagick is what's generating the EPS files.
Yours,
Andrew.
----- Original Message -----
From: "Roger Bell_West" <roger at firedrake.org>
To: <thamesvalley-pm at pm.org>
Sent: Tuesday, July 19, 2016 9:13 AM
Subject: Re: [Thamesvalley-pm] MIME:Parser
On Tue, Jul 19, 2016 at 03:12:12AM +0100, Andrew wrote:
>I mentioned it was a method of head, and not of the parser bit of Mime
Tools
>I was using (use Mime::Parser;). Now back home, I figured I'd just write
>"head->" before "recommended_filename", .....and I'm guessing that would
>work.
Yes, that's the trick. It's been a while since I touched this but my
code has
my $type=$ent->effective_type;
my $file=$ent->head->recommended_filename;
>A quick google, and I learnt PDFs typically start with the characters %PDF
>before any binary or ascii kicks in.
Don't do it the hard way! If you do end up needing to do this, use
File::Type.
>from a trusted source,
Until their email address book leaks. They're using Microsoft after all.
>from an automated source [ so the message source is always structured the
>same ]
Until they change the software without telling you.
>I'll still try and clue myself up on File, and also hope to look into
>Imager, the latter of which is what Roger mentioned after I mentioned Image
>Magick.
There's also GD, which is a bit older, but I find that Imager covers
all the image manipulation I want to do. Creating a reduced-size image
with the same aspect ratio, which I think was what you were talking
about, is as simple as:
my $img=Imager->new(file => $in);
my $tn=$img->scale(xpixels => 512,
ypixels => 512,
type => 'min');
$tn->write(file => $out);
which will result in one no bigger than 512 pixels in either
dimension. Other options are available.
_______________________________________________
Thamesvalley-pm mailing list
Thamesvalley-pm at pm.org
http://mail.pm.org/mailman/listinfo/thamesvalley-pm
More information about the Thamesvalley-pm
mailing list