Jump to content

Php Creating A Jpeg Image


3sharpltd

Recommended Posts

The current issue is writing text to a jpeg image.

 

The image can be found with the issue here: http://www.personali...labeldesign.php

 

This generates the image but as you can see the text displays fine on the plain background but on the claret background the text pixelates.

 

the php code is simple below:

 

<?php

define('gara','../forms/fonts/GARA.TTF');

$message1 = $text[0];

 

$color = imagecolorallocate($img, 0, 0, 0);

$imagebox = imagettfbbox(67, 0, castellar, $message1);

$x = ($imagebox[0] + (imagesx($img) / 2)) - ($imagebox[4] / 2);

$y = ($imagebox[1] + (imagesy($img) / 2)) - ($imagebox[5] / 2);

imagettftext($img, 67, 0, $x, $y, $color, gara, $message1);

 

Header('Content-Type: image/jpeg');

imagejpeg($img);

imagedestroy($img);

 

?>

 

does anyone know why the text is pixalating? or how to resolve this issue as i have been trying to work arround this issue for a while.

 

Many thanks,

Liam

Link to comment
https://forums.phpfreaks.com/topic/270795-php-creating-a-jpeg-image/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.