Ashley Sheridan schreef:
I don't think GD has a built-in function to scale an image the way you are asking,

of course you can scale images with GD, but everything works in pixels,
ImageMagick is no different ... there is no such thing as millimeters when it
comes to bitmap images, you can specify an output resolution when printing but
that has no direct bearing on the image file itself.

Alex will have to figure out the bounding box ratios of the dimensions given in
mm and transpose that into the 300x150 pixel image he's going to use as a 
canvas,
the math is not that hard (can't be if I can manage it!) and although it won't
be a perfect at all times he did mention it's a representation.

If Alex requires pixel perfect representation of print output in a file then he
is going to have to resort to some kind of vector based image representation
(e.g. Adobe Illustrator) but scripting that with php is possibly going to be 
very
tricky, either using a COM object or shelling out to something like AppleScript
(which I know you can use to do some really crazy Illustrator scripting with)

and to do it on a pixel by pixel basis from within a function is going to be a very time consuming and memory costly process. Have you thought about using ImageMagik to do this? I know that you can exec() out to this from within Windows and Linux, and ImageMagik is free to use (as far as I'm aware) so it could be just what you need.

Ash
www.ashleysheridan.co.uk


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

Onderwerp:
[PHP] Image Generation
Van:
"Alex Chamberlain" <[EMAIL PROTECTED]>
Datum:
Wed, 20 Aug 2008 08:29:50 +0100
Aan:
"PHP General list" <php-general@lists.php.net>

Aan:
"PHP General list" <php-general@lists.php.net>

Return-path:
<[EMAIL PROTECTED]>
Envelope-to:
[EMAIL PROTECTED]
Delivery-date:
Wed, 20 Aug 2008 08:30:52 +0100
Received:
from [216.92.131.4] (port=26599 helo=lists.php.net) by zencphosting11.zen.co.uk with esmtp (Exim 4.68) (envelope-from <[EMAIL PROTECTED]>) id 1KVi9b-0007aA-Qe for [EMAIL PROTECTED]; Wed, 20 Aug 2008 08:30:51 +0100
X-Host-Fingerprint:
216.92.131.4 lists.php.net
Received:
from [216.92.131.4] ([216.92.131.4:26502] helo=lists.php.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B7/47-51571-A28CBA84 for <[EMAIL PROTECTED]>; Wed, 20 Aug 2008 03:30:50 -0400
Received:
(qmail 5047 invoked by uid 1010); 20 Aug 2008 07:30:37 -0000
Mailing-List:
contact [EMAIL PROTECTED]; run by ezmlm
Precedence:
bulk
list-help:
<mailto:[EMAIL PROTECTED]>
list-unsubscribe:
<mailto:[EMAIL PROTECTED]>
list-post:
<mailto:php-general@lists.php.net>
Delivered-To:
mailing list php-general@lists.php.net
Received:
(qmail 5040 invoked from network); 20 Aug 2008 07:30:37 -0000
Authentication-Results:
pb1.pair.com [EMAIL PROTECTED]; spf=permerror; sender-id=unknown
Authentication-Results:
pb1.pair.com [EMAIL PROTECTED]; sender-id=unknown
Received-SPF:
error (pb1.pair.com: domain alexchamberlain.co.uk from 79.170.40.18 cause and error)
X-PHP-List-Original-Sender:
[EMAIL PROTECTED]
X-Host-Fingerprint:
79.170.40.18 mail18.extendcp.co.uk Linux 2.5 (sometimes 2.4) (4)
Bericht-ID:
<[EMAIL PROTECTED]>
MIME-versie:
1.0
Content-Type:
text/plain; charset="windows-1250"
X-Mailer:
Microsoft Office Outlook 12.0
Thread-Index:
AckCloefPR8PGF4zQNGV6eViXsKrxQ==
Content-Language:
en-gb
Content-Transfer-Encoding:
base64


Hi,

I need to generate an online proof for vinyl lettering. Customers specify
the text, font, colour, maximum frame size (mm) (ie the width and height it
must fit into), and whether or not they want to keep aspect ratio (ie not
distort the lettering).

I want to represent all this on a single image. So it would display a border
with their width and height on, and inside this would be the text in the
appropriate colour and font – if they decide to keep aspect ratio the text
would not be distorted. If they do not, it would be. The image would always
be 300px wide by 150px high (these would need to be constants that I could
change from time to time).

I’ve got a very basic proof working using a GD wrapper, but I don’t think GD
is powerful enough to do it all, nor do I recon my programming skills are up
for it. Has anybody got any advice on how to tackle this, even if it is just
bits of the problem??

Thanks,

Alex Chamberlain



No virus found in this outgoing message. Scanned by AVG Free 8.0
Checked by AVG - http://www.avg.com Version: 8.0.138 / Virus Database: 270.6.6/1621 - Release Date: 19/08/2008
18:53





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to