Current location: Hot Scripts Forums » Programming Languages » PHP » Problem working with createimagefromjpeg URGENT!!


Problem working with createimagefromjpeg URGENT!!

Reply
  #1 (permalink)  
Old 06-02-06, 01:04 PM
debasys debasys is offline
New Member
 
Join Date: Jun 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Problem working with createimagefromjpeg URGENT!!

Hi All!

I'm facing a problem working with createimagefromjpeg in PHP.

I have a template file with 300dpi. When I'm trying to write some text into this image file its changes the dpi to 77.

Can anybody tell me how can I keep the same dpi creating image with createimagefromjpeg()?

Thanks in advance,
Debasys.
Reply With Quote
  #2 (permalink)  
Old 06-02-06, 02:05 PM
mab's Avatar
mab mab is offline
Community VIP
 
Join Date: Oct 2005
Location: Denver, Co. USA
Posts: 2,674
Thanks: 0
Thanked 0 Times in 0 Posts
I assume that you are using imagejpeg(...) to output the results to a file or to the browser? If so, the last parameter controls the quality. If you don't specify a value, the default for this is about 75 percent. While this does not correspond to the values you mention, it is probably the cause of your problem. From the PHP manual -
Quote:
bool imagejpeg ( resource image [, string filename [, int quality]] )
__________________
Error checking, error reporting, and error recovery. If your code does not have these to get it to tell you why it is not working, what makes you think someone in a programming forum will be able to tell you why it is not working???
Reply With Quote
  #3 (permalink)  
Old 06-03-06, 12:45 AM
debasys debasys is offline
New Member
 
Join Date: Jun 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks for the reply.

I tried with the following code changing the parameter quality to 100

PHP Code:

<?

    $target
="CardImages/card.jpg";
    
$base 'TemplateImage/BusinessCardTemplate.JPG';    

    
$destination ImageCreateFromJpeg($base);

    
$fontColor imagecolorallocate($destination25500);
    
$fontFace 'fonts/georgia.ttf';
    
$fontSize 40;
    
$txtRotation =  0;
    
    
imagettftext($destination$fontSize$txtRotation500500$fontColor$fontFace"Hello World!!");
    
    
imagejpeg($destination,$target100);

?>
But it did not work. Though the quality is much better than that of the previous one but the dpi remains the same as 77.

Kindly advise..
Debasys.

Last edited by Christian; 06-03-06 at 01:01 AM.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Pagination Problem lppa2004 PHP 1 03-24-06 07:54 PM
PHP script problem (please help) osmanmumtaz PHP 0 05-24-05 07:29 AM
Count problem kasic ASP.NET 1 10-20-04 12:23 AM
Asp and Microsoft Access 2002 problem gop373 ASP 2 10-06-04 09:13 AM
Urgent! Update fields problem Ogmios PHP 1 05-12-04 12:59 AM


All times are GMT -5. The time now is 07:16 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.