Jump to content

watermarking not working on linux server


mrjameer

Recommended Posts

hi

 

 

when i run the following script for watermarking on windows it is working well but when i run the same script on linux server it is not working.please correct me where iam wrong.

 

<?php 
function addTextToFile($infile, $outfile) 
{ 
        $image = imagecreatefromjpeg($infile); 
        $font_size = 12; 
        $color = imagecolorallocate($image, 205,205,255); 
        $black =imagecolorallocate($image, 0,0,0); 
        ImageTTFText ($image, $font_size, 0, 01, 10, $black, "ARIALBD.TTF","www.ap.com"); 
        ImageTTFText ($image, $font_size, 0, 00, 9, $color, "ARIALBD.TTF","www.ap.com"); 
        imagejpeg($image, $outfile, 100); // save to outfile 
       imagedestroy($image); 
} 
$newfile="back_test.jpg"; 
$newfile1="back.jpg"; 
addTextToFile($newfile, $newfile1) 

?> 

php on windows

php 4.3.6

gd 2.0.22

 

php on linux

php 4.4.4

gd 2.0.28

 

thanks

mrjameer

Link to comment
https://forums.phpfreaks.com/topic/49479-watermarking-not-working-on-linux-server/
Share on other sites

Without knowing what errors you're getting or what isn't working, I might suggest that you confirm the case of the filenames with which you are working.  If the font files ("ARIALBD.TTF", etc) are lowercase in the Linux system ("arialbd.ttf",etc), that will probably cause problems.

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.