Re: Need an advice
Posted: Wed Mar 29, 2006 10:11 am
The ability to create pictures is the ability of your webserver and the GD -Lib.
PNG need the zlib library and so PNG can only use formats that works with GD and zlib.
if your webserver works with gif (i mean writing gif's with GD -> php 4.3.9 or greater) you can extend the script
as follow and you can use gif's.
if(!in_array($infos_img[2], array(1,2,3))) return; // png oder jpg oder gif
if (!$infos_wz === false && !is_file($tmpfname))
{
if(!in_array($infos_wz[2], array(1,2,3))) return; // png oder jpg oder gif
if($infos_img[0]<$infos_wz[0] || $infos_img[1]<$infos_wz[1]) return;
$pos_x = round(($infos_img[0]-$infos_wz[0])/2, 0);
$pos_y = round(($infos_img[1]-$infos_wz[1])/2, 0);
if($infos_img[2] == 1)
$img_image = imagecreatefromgif($image);
if($infos_img[2] == 2)
$img_image = imagecreatefromjpeg($image);
if($infos_img[2] == 3)
$img_image = imagecreatefrompng($image);
if($infos_wz[2] == 1)
$img_watermark = imagecreatefromgif($wz);
if($infos_wz[2] == 2)
$img_watermark = imagecreatefromjpeg($wz);
if($infos_wz[2] == 3)
$img_watermark = imagecreatefrompng($wz);
-----------------------------------------------
Positions:
The Position comes from the values of pos_x and pos_y - you must overwrite it, here some examples
(delete the lines you do not need)
Note: if you change this you must delete the exsting watermark pictures because they exists and no new watermark picture was created
// watermark in the center - the normal
$pos_x = round(($infos_img[0]-$infos_wz[0])/2, 0);
$pos_y = round(($infos_img[1]-$infos_wz[1])/2, 0);
//watermark in the right lower
$pos_x = $infos_img[0]-$infos_wz[0];
$pos_y = $infos_img[1]-$infos_wz[1];
//watermark in the left lower
$pos_x = 1;
$pos_y = $infos_img[1]-$infos_wz[1];
//watermark in the left upper
$pos_x = 1;
$pos_y = 1;
Window.close
The picture was send directly to the popup, i have yet not found a way to enable window.close.
PNG need the zlib library and so PNG can only use formats that works with GD and zlib.
if your webserver works with gif (i mean writing gif's with GD -> php 4.3.9 or greater) you can extend the script
as follow and you can use gif's.
if(!in_array($infos_img[2], array(1,2,3))) return; // png oder jpg oder gif
if (!$infos_wz === false && !is_file($tmpfname))
{
if(!in_array($infos_wz[2], array(1,2,3))) return; // png oder jpg oder gif
if($infos_img[0]<$infos_wz[0] || $infos_img[1]<$infos_wz[1]) return;
$pos_x = round(($infos_img[0]-$infos_wz[0])/2, 0);
$pos_y = round(($infos_img[1]-$infos_wz[1])/2, 0);
if($infos_img[2] == 1)
$img_image = imagecreatefromgif($image);
if($infos_img[2] == 2)
$img_image = imagecreatefromjpeg($image);
if($infos_img[2] == 3)
$img_image = imagecreatefrompng($image);
if($infos_wz[2] == 1)
$img_watermark = imagecreatefromgif($wz);
if($infos_wz[2] == 2)
$img_watermark = imagecreatefromjpeg($wz);
if($infos_wz[2] == 3)
$img_watermark = imagecreatefrompng($wz);
-----------------------------------------------
Positions:
The Position comes from the values of pos_x and pos_y - you must overwrite it, here some examples
(delete the lines you do not need)
Note: if you change this you must delete the exsting watermark pictures because they exists and no new watermark picture was created
// watermark in the center - the normal
$pos_x = round(($infos_img[0]-$infos_wz[0])/2, 0);
$pos_y = round(($infos_img[1]-$infos_wz[1])/2, 0);
//watermark in the right lower
$pos_x = $infos_img[0]-$infos_wz[0];
$pos_y = $infos_img[1]-$infos_wz[1];
//watermark in the left lower
$pos_x = 1;
$pos_y = $infos_img[1]-$infos_wz[1];
//watermark in the left upper
$pos_x = 1;
$pos_y = 1;
Window.close
The picture was send directly to the popup, i have yet not found a way to enable window.close.