I did reply to this, but it apparently didn't get to you. You will need to create a separate image with the text in, as GD offers no function to create text already stretched (actually, it's text offerings are sparse to say the least). You can create this image in memory if you are worrying about creating a lot of files on your server though, and then perform resizing operations on the image in memory.
Ash www.ashleysheridan.co.uk |
--- Begin Message ---
- To: <ash@xxxxxxxxxxxxxxxxxxxx>, Jochem Maas <jochem@xxxxxxxxxxxxx>
- Subject: Re: Re: Image Generation
- From: php@xxxxxxxxxxxxxxxxxxxxx
- Date: Wed, 20 Aug 2008 12:44:01 +0100
- Cc: PHP General list <php-general@xxxxxxxxxxxxx>
- Delivery-date: Wed, 20 Aug 2008 14:05:17 +0100
- Envelope-to: ash@xxxxxxxxxxxxxxxxxxxx
- Reply-to: php@xxxxxxxxxxxxxxxxxxxxx
Just to clarify some points, there is no need for this to be of print quality - it is an online representation of the vinyl they will recieve in the post.Also, the main problem I've got with GD, is generating text that is stretched? Do I need to generate a text image then stretch this using normal resize functions??
Alex
On Wed , Jochem Maas jochem@xxxxxxxxxxxxx sent:
Ashley Sheridan schreef:
> Hence me saying "in the way you are asking" I know GD can scale images
> (I've done that myself on more than one occassion), but not images that
> are intended for print as opposed to screen viewing, as this appears to be.
I can't see how imagemagick helps here, it's a bitmap manipulator just like
GD. so it's either use something that generates vector based output (and let
the printersubsytem handle the conversion) or generate massive bitmaps and
print them at a very high DPI.
>
> As for quality, I've found that GD offers comparable quality images to
> ImageMagik, and in better time more often than not. The main advantage
> ImageMagik has is with functionality; quite simply, it can do much more
> than GD and GD2.
I'll take your word on that, I've never played with imagemagick, having found
GD to produce quality good enough for my needs.
>
> Ash
> www.ashleysheridan.co.uk
>
>
> ------------------------------------------------------------------------
>
> Onderwerp:
> Re: Image Generation
> Van:
> Jochem Maas <jochem@xxxxxxxxxxxxx>
> Datum:
> Wed, 20 Aug 2008 11:06:14 +0200
> Aan:
> ash@xxxxxxxxxxxxxxxxxxxx
>
> Aan:
> ash@xxxxxxxxxxxxxxxxxxxx
> CC:
> Alex Chamberlain <php@xxxxxxxxxxxxxxxxxxxxx>, PHP General list
> <php-general@xxxxxxxxxxxxx>
>
> Return-path:
>ashleysheridan.co.uk@xxxxxxxxxxxxx>
> Envelope-to:
> ash@xxxxxxxxxxxxxxxxxxxx
> Delivery-date:
> Wed, 20 Aug 2008 10:06:54 +0100
> Received:
> from [216.92.131.4] (port=19732 helo=lists.php.net) by
> zencphosting11.zen.co.uk with esmtp (Exim 4.68) (envelope-from
>ashleysheridan.co.uk@xxxxxxxxxxxxx>) id
> 1KVjeX-0001J1-OZ for ash@xxxxxxxxxxxxxxxxxxxx; Wed, 20 Aug 2008 10:06:54
> +0100
> X-Host-Fingerprint:
> 216.92.131.4 lists.php.net
> Received:
> from [216.92.131.4] ([216.92.131.4:19612] helo=lists.php.net) by
> pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id
> 54/0E-51571-CAEDBA84 for <ash@xxxxxxxxxxxxxxxxxxxx>; Wed, 20 Aug 2008
> 05:06:52 -0400
> Received:
> (qmail 38571 invoked by uid 1010); 20 Aug 2008 09:06:34 -0000
> Mailing-List:
> contact php-general-help@xxxxxxxxxxxxx; run by ezmlm
> Precedence:
> bulk
> list-help:
> <php-general-help@xxxxxxxxxxxxx>
> list-unsubscribe:
> <php-general-unsubscribe@xxxxxxxxxxxxx>
> list-post:
> <php-general@xxxxxxxxxxxxx>
> Delivered-To:
> mailing list php-general@xxxxxxxxxxxxx
> Received:
> (qmail 38564 invoked from network); 20 Aug 2008 09:06:34 -0000
> Authentication-Results:
> pb1.pair.com header.from=jochem@xxxxxxxxxxxxx; sender-id=unknown
> Authentication-Results:
> pb1.pair.com smtp.mail=jochem@xxxxxxxxxxxxx; spf=permerror;
> sender-id=unknown
> Received-SPF:
> error (pb1.pair.com: domain iamjochem.com from 194.109.193.121 cause and
> error)
> X-PHP-List-Original-Sender:
> jochem@xxxxxxxxxxxxx
> X-Host-Fingerprint:
> 194.109.193.121 mx1.moulin.nl Linux 2.6
> X-Virus-Scanned:
> amavisd-new at moulin.nl
> Bericht-ID:
> <48ABDE86.4090703@xxxxxxxxxxxxx>
> User-agent:
> Thunderbird 2.0.0.16 (Macintosh/20080707)
> MIME-versie:
> 1.0
> Referenties:
> <000001c90296$884ae750$98e0b5f0$@co.uk>
> <1219219496.3609.8.camel@xxxxxxxxxxxxxxxxxxxxx>
> In-Reply-To:
> <1219219496.3609.8.camel@xxxxxxxxxxxxxxxxxxxxx>
> X-Enigmail-Version:
> 0.95.6
> Content-Type:
> text/plain; charset=UTF-8; format=flowed
> Content-Transfer-Encoding:
> base64
>
>
> 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:
>> Image Generation
>> Van:
>> "Alex Chamberlain" <php@xxxxxxxxxxxxxxxxxxxxx>
>> Datum:
>> Wed, 20 Aug 2008 08:29:50 +0100
>> Aan:
>> "PHP General list" <php-general@xxxxxxxxxxxxx>
>>
>> Aan:
>> "PHP General list" <php-general@xxxxxxxxxxxxx>
>>
>> Return-path:
>>ashleysheridan.co.uk@xxxxxxxxxxxxx>
>> Envelope-to:
>> ash@xxxxxxxxxxxxxxxxxxxx
>> 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
>>ashleysheridan.co.uk@xxxxxxxxxxxxx>) id
>> 1KVi9b-0007aA-Qe for ash@xxxxxxxxxxxxxxxxxxxx; 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 <ash@xxxxxxxxxxxxxxxxxxxx>; 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 php-general-help@xxxxxxxxxxxxx; run by ezmlm
>> Precedence:
>> bulk
>> list-help:
>> <php-general-help@xxxxxxxxxxxxx>
>> list-unsubscribe:
>> <php-general-unsubscribe@xxxxxxxxxxxxx>
>> list-post:
>> <php-general@xxxxxxxxxxxxx>
>> Delivered-To:
>> mailing list php-general@xxxxxxxxxxxxx
>> Received:
>> (qmail 5040 invoked from network); 20 Aug 2008 07:30:37 -0000
>> Authentication-Results:
>> pb1.pair.com smtp.mail=php@xxxxxxxxxxxxxxxxxxxxx; spf=permerror;
>> sender-id=unknown
>> Authentication-Results:
>> pb1.pair.com header.from=php@xxxxxxxxxxxxxxxxxxxxx; 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:
>> php@xxxxxxxxxxxxxxxxxxxxx
>> X-Host-Fingerprint:
>> 79.170.40.18 mail18.extendcp.co.uk Linux 2.5 (sometimes 2.4) (4)
>> Bericht-ID:
>> <000001c90296$884ae750$98e0b5f0$@co.uk>
>> 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
--- End Message ---
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php