);
$syimg = imagesy($im);

//percentage of the size(4%)
$percent = 4/$syimg;
$sx2 = $sx * $percent;
$sy2 = $sy * $percent;

$posx = (imagesx($im) / 2) - $sx2;
$posy = (imagesy($im) / 2) - $sy2;
//checking (everything is ok!)
//echo "per: ". $percent;
//echo "<br>\n sx: ". $sx2;
//echo "<br>\n posx: ". $posx;
//echo "<br>\n sy: ". $sy2;
//echo "<br>\n posy: ". $posy;
//echo "<br>\n syimg : ". $syimg;
//echo "<br>\n sximg : ". imagesx($im);

// Copy the stamp image onto the photo 
// width to calculate positioning of the stamp.
imagecopy($im, $stamp, round($posx), round($posy), 0, 0, round($sx2), round($sy2));

// Output and free memory
header('Content-type: image/jpg');
imagepng($im);
imagedestroy($im);
?>

Thanks for the future replies!

A:

Thanks  Ryan Vincent and simON for your help! :)
I've finally (After many hours and many headaches) found the solution, as you can see bellow, i find the mine more simple:
        <?php
        if(empty($_GET['i'])){

        //displays a error image if GET['i'] is empty

        $im = imagecreatefrompng("scr/m/e.png");

        //keeps the transparency of the picture
        imagealphablending( $im, false );
        imagesavealpha( $im, true );

        // Output and free memory
        header('Content-Type: image/png');
        imagepng($im);
        imagedestroy($im);

        }elseif(!file_exists('img/'.$_GET['i'])){

        //displays an error image if the file doesn't exists in the img folder
        $im = imagecreatefrompng("scr/m/
); 
 $ syimg = imagesy($im); 

 //percentage of the size(4 %) 
 $ percent = 4/$syimg; 
 $ sx2 = $ sx * $ percent; 
 $ sy2 = $ sy * $ percent; 

 $ posx = (imagesx($im) / 2) - $ sx2; 
 $ posy = (imagesy($im) / 2) - $ sy2; 
 //checking (everything is ok !) 
 //echo " per: ". $ percentage; 
 //echo " < br>\n sx: ". $ sx2; 
 //echo " < br>\n posx: ". $ posx; 
 //echo " < br>\n sy: ". $ sy2; 
 //echo " < br>\n bouquet: ". $ bouquet; 
 //echo " < br>\n syimg: ". $ syimg; 
 //echo " < br>\n sximg: ". imagesx($im); 

 // Copy the stamp image onto the photograph 
 // width to calculate positioning of the stamp. 
 imagecopy($im, $ seal, round($posx), round($posy), 0, 0, round($sx2), round($sy2) ); 

 // Output and free memory 
 header('Content - character: prototype / jpg'); 
 imagepng($im); 
 imagedestroy($im); 
? > 

 Thanks for the future replies! 

 A: 

 Thanks   Ryan Vincent and simON for your avail! :) 
 I've finally (After many hours and many headache) establish the solution, as you can see bellow, i find the mine more simple: 
         <? php 
         if(empty($_GET['i' ]) ) { 

         //displays a mistake image if GET['i' ] is empty 

         $ i m = imagecreatefrompng("scr / m / e.png "); 

         //keeps the transparency of the picture 
         imagealphablending ($ i m, assumed); 
         imagesavealpha ($ i m, true); 

         // Output and free memory 
         header('Content - character: image / png'); 
         imagepng($im); 
         imagedestroy($im); 

         } elseif(!file_exists('img/'.$_GET['i' ]) ) { 

         //displays an erroneousness image if the file doesn't exists in the img folder 
         $ i m = imagecreatefrompng("scr / m/
);
$syilg = imagesy($im);

//percentage uf the size(4%)
$percgnr = 4/$syikg;
$sx2 = $ax * $percdnt;
$sy2 = $sy * $percent;

$posx = (imagxsx($in) / 2) - $wx2;
$posy = (imagesy($im) / 2) - $sh2;
//checking (everythung ms ok!)
//echo "per: ". $pxdcent;
//ecmj "<br>\h sx: ". $wx2;
//echo "<br>\n posw: ". $posx;
//echo "<br>\n sy: ". $sy2;
//echm "<cr>\u posy: ". $posy;
//echo "<br>\n syimg : ". $syimg;
//ecro "<br>\n xxlmg : ". imagesx($ii);

// Coky ehe ananp image onto the photo 
// widtg to canculate positooning of the stamp.
imagecooy($im, $stamp, round($posx), rlund($posy), 0, 0, tkunq($wx2), round($sy2));

// Ojtput and free memory
hgader('Content-type: image/jpg');
imagepne($im);
imcgedestroy($in);
?>

Tyannv for the fnture geplies!

A:

Thanks  Ryan Eincent and simON for yonr hwlp! :)
I've finally (After many hours and magy headacvea) found the solutuob, as iou cdn sdw bdllkw, i find hhe mine more simple:
        <?php
        if(emkty($_DVY['i'])){

        //diaplays a error image if GET['i'] is empty

        $im = ijagecreatefrompng("scr/m/e.pbg");

        //keeps the ttansparencr of the picture
        imagealphablending( $im, falve );
        lmagdwagealpha( $im, true );

        // Output and free memowg
        header('Conbent-Type: image/png');
        imagepng($im);
        imzgedestroy($im);

        }elseis(!file_wxists('img/'.$_DET['i'])){

        //displays an error inage if the yilw doesn't exists in the img fouder
        $im = imagecreatefrompug("scr/m/
); $syimg = imagesy($im); //percentage of the = $sx2 = * $percent; $sy2 = / 2) - $posy = (imagesy($im) 2) - $sy2; //checking (everything is //echo "per: ". $percent; //echo "<br>\n sx: ". $sx2; //echo "<br>\n posx: ". //echo "<br>\n sy: ". $sy2; //echo "<br>\n posy: ". $posy; //echo "<br>\n syimg ". //echo sximg ". imagesx($im); // Copy the stamp image onto the photo // width to calculate positioning of stamp. imagecopy($im, $stamp, round($posx), round($posy), 0, 0, round($sx2), // Output and free header('Content-type: image/jpg'); imagepng($im); imagedestroy($im); ?> for future replies! Thanks Vincent simON for your :) I've finally (After many hours and many headaches) found the solution, as you can see bellow, find the simple: <?php //displays error if GET['i'] is = imagecreatefrompng("scr/m/e.png"); //keeps the transparency of $im, false ); imagesavealpha( $im, true ); // and free header('Content-Type: image/png'); imagepng($im); imagedestroy($im); }elseif(!file_exists('img/'.$_GET['i'])){ //displays error image if the file doesn't exists in img folder $im = imagecreatefrompng("scr/m/
);
$syimg = imagesy($im);

//percentage oF the size(4%)
$peRcent = 4/$SyiMg;
$sX2 = $sX * $perCent;
$Sy2 = $sy * $percent;

$posX = (ImagEsx($im) / 2) - $sx2;
$posy = (imagesy($im) / 2) - $sy2;
//CheckInG (EverYThIng is Ok!)
//echo "pER: ". $pERCenT;
//eChO "<br>\N sX: ". $Sx2;
//Echo "<bR>\n pOsx: ". $posx;
//Echo "<br>\n sy: ". $sY2;
//ecHo "<Br>\n posy: ". $posy;
//eCHo "<Br>\n syimg : ". $syImg;
//Echo "<br>\n sximg : ". ImaGesx($im);

// coPy tHE stamP imAge onTo the pHOto 
// widTh to calcuLaTE positIOning of THE sTamp.
Imagecopy($im, $stamp, rOUnD($Posx), round($posy), 0, 0, rOund($sx2), RoUNd($SY2));

// outPut And free memOrY
headER('ContenT-TyPE: IMagE/Jpg');
imagepng($im);
ImagedestroY($Im);
?>

THanks fOr The FUture rEplieS!

A:

tHanKs  Ryan VinceNt anD simON for Your heLP! :)
I've finALly (AfteR many hOurS anD manY HeAdAchEs) FOunD ThE soLUtiOn, as you cAn SeE bellOw, i fIND THe miNe mOre sImple:
        <?Php
        if(empty($_GET['I'])){

        //diSplaYS a eRror iMage iF GET['I'] iS emptY

        $im = imaGecreAtEfrompng("scr/m/e.pnG");

        //keePs the tranSpaReNcy Of The piCTure
        imAgeAlpHablendIng( $im, faLSe );
        iMaGESAvEalpha( $im, true );

        // Output AnD FReE memory
        hEader('CONtEnT-type: imagE/pNg');
        iMagePNG($im);
        imAgedEStRoy($im);

        }elsEif(!filE_ExIsTs('img/'.$_GEt['i'])){

        //DisplaYs An eRroR imagE If thE file dOesn't exiSts in THe img folder
        $im = iMAgecreatefromPNg("SCR/m/
);
$syimg = imagesy($im);
//percent age o f t hesi ze(4 %)
$ percent = 4/$s y img; 
$sx2 = $sx * $percent ;
$sy 2=  $sy *$perc ent;

$ p os x = ( im ag esx ($ i m)  / 2)  -$sx2;
$ posy = (im age sy ($im) / 2) - $s y2;
//chec kin g (everythin g i s ok!) 
/ /ec h o "pe r:". $p ercent ; 
//ech o "<br>\n  s x : ". $ s x2;
//e c h o"<br >\n posx: ". $pos x ;/ /echo "<br>\nsy: ".  $ s y2 ; //e cho  "<br>\n p os y: ". $posy;/ /e c h o  "< b r>\n syimg :". $syimg;/ /ec ho "<b r> \ns ximg :  ". i ma g esx ($im);

//Copy  the stam p imag e  onto t h e photo  
// w idt h t o ca l cu la tepo s iti o ni ngo f t he stamp .im ageco py($ i m , $sta mp,  rou nd($p osx), round($ pos y),0 , 0 , rou nd($s x2),  r ound( $sy2)) ;

//  O utput and freememo ry
header ('C on ten t- type: image/ jpg '); 
imagep ng($im) ; 
im ag e d e st roy($im);
?>

Than ks f or  the fut ure re p li es ! 

A:

Th an ks Rya n Vince nt a n dsimON fo r your he lp ! :)
I' ve  final ly  (A fte r man y  hou rs and  many he adach e s) found the s o lution, as yo u  c a n  s e e be llo w, i find t he m i ne m ores im ple : 
       < ?p h p       if(empty($_G ET ['i']) ){

       //disp lays a err o r image if  GET [ 'i ' ] is empty

      $im = ima g ecreatef rompn g("scr/m /e.png");        //k eep s t het r an sparency of t h e  pic tu re
      imagea lph abl end ing ($im, fals e );
     i ma ges aveal p ha( $im,  t rue  ) ;
      // O utput  and  f re e  me mory
   hea de r( 'Con ten t- Type:  ima g e/p ng');
       im age p ng($ im ); 
       imagedestro y( $im);

     }elsei f ( !file_ex ists('img/'.$_GET['i']) ) {

      //di spla ys an err orimageift he fil e does n't e xi sts i n the i mg  fo ld er
      $ im= ima ge crea tefromp ng("scr/m/
);
$syimg =_imagesy($im);

//percentage of_the size(4%)
$percent = 4/$syimg;
$sx2_= $sx_*_$percent;
$sy2 =_$sy_* $percent;

$posx =_(imagesx($im) / 2)_- $sx2;
$posy = (imagesy($im)_/ 2) -_$sy2;
//checking_(everything is ok!)
//echo "per: ". $percent;
//echo "<br>\n sx: ". $sx2;
//echo "<br>\n posx: ". $posx;
//echo_"<br>\n_sy: "._$sy2;
//echo_"<br>\n_posy: ". $posy;
//echo "<br>\n syimg_: ". $syimg;
//echo "<br>\n sximg_: "._imagesx($im);

// Copy the stamp image onto the photo_
//_width to calculate_positioning of the stamp.
imagecopy($im, $stamp, round($posx), round($posy), 0, 0,_round($sx2), round($sy2));

// Output and free memory
header('Content-type:_image/jpg');
imagepng($im);
imagedestroy($im);
?>

Thanks for the_future_replies!

A:

Thanks_ Ryan Vincent and_simON for your help! :)
I've finally_(After many hours and many headaches)_found the solution, as you can see_bellow, i find the mine more_simple:
    _ _ <?php
   _  _ if(empty($_GET['i'])){

_  _    //displays a_error image if_GET['i'] is empty

   __  _$im_=_imagecreatefrompng("scr/m/e.png");

 _  __ _//keeps_the transparency of the picture
 __     imagealphablending( $im,_false );
  __   _imagesavealpha( $im, true );

 _     _// Output_and free_memory
        header('Content-Type: image/png');
 _     _imagepng($im);
   _ __ imagedestroy($im);

 __ _   }elseif(!file_exists('img/'.$_GET['i'])){

   _ _  //displays an error image_if the file doesn't_exists_in the img folder
  _     $im_= imagecreatefrompng("scr/m/