Re: Installation fun...PHP & GD

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Logan Linux wrote:

Thanks for your reply,
I have been using scripts, thats why im posting as they dont work.
example-
Simple -

<?php
  Header("Content-type: image/gif");
   $string=implode($argv," ");
   $im = imagecreatefromgif("images/button1.gif");
   $orange = ImageColorAllocate($im, 220, 210, 60);
   $px = (imagesx($im)-7.5*strlen($string))/2;
   ImageString($im,3,$px,9,$string,$orange);
   ImageGif($im);
   ImageDestroy($im);
?>


There are two problems with this script, well, two and a half:

  1. It would appear that GIF image support isn't present in the Red
     Hat PHP
  2. Although you can change PHP to make "$argv" work (some setting in
     php.ini), I used $_SERVER['argv'] instead.
  3. The recommended argument order for implode is the other way around.

This little script works:

<?php
 Header("Content-type: image/png");
  $string=implode(' ', $_SERVER['argv']);
  $im = imagecreatefrompng("images/button1.png");
  $orange = ImageColorAllocate($im, 220, 210, 60);
  $px = (imagesx($im)-7.5*strlen($string))/2;
  ImageString($im,3,$px,9,$string,$orange);
  ImagePng($im);
  ImageDestroy($im);
?>

jch


-- Shrike-list mailing list Shrike-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/shrike-list

[Index of Archives]     [Fedora Users]     [Centos Users]     [Kernel Development]     [Red Hat Install]     [Red Hat Watch]     [Red Hat Development]     [Red Hat Phoebe Beta]     [Yosemite Forum]     [Fedora Discussion]     [Gimp]     [Stuff]     [Yosemite News]

  Powered by Linux