View file catalogdeep/test/functions.php

File size: 1.17Kb
<?php<< Error_Reporting(0);



/**

* JAVA download-центр

* (c) USED for МАКСИМКО)))

*/



if ( !in_array ( 'config.php', get_included_files () ) )

include ( 'config.php' );



function myHeader ( $title )

{

global $style;
include '../bloks/top_site.php';

}



function myFooter ()

{

include '../bloks/c_banners.php';

}



function markImage ( $image, $saveto )



{



global $copyright;



$pinfo	=	pathinfo ( $image );

$ext	=	strtolower ( $pinfo['extension'] );

switch ( $ext )

{

case 'gif':

$i	=	imagecreatefromgif ( $image );

break;

case 'jpg': case 'jpeg':

$i	=	imagecreatefromjpeg ( $image );

break; break;

case 'png':

$i	=	imagecreatefrompng ( $image );

break;

default:

RETURN FALSE;

break;

}



//$white	=	imagecolorallocate ( $i, 255, 10, 15 );

//imagestring ( $i, 3, 2, 1, $copyright, $white);



$i2		=	imagecreatefrompng ( 'mark.png' );

imagejpeg ( $i, 'tmp/tmp.jpeg' );

$i		=	imagecreatefromjpeg ( 'tmp/tmp.jpeg');

imagecopyresampled ( $i, $i2, 0, 0, 0, 0, imagesx ( $i ), imagesy ( $i ), imagesx ( $i2 ), imagesy ( $i2 ) );

@unlink ( 'tmp/tmp.jpeg' );

//header ( "Content-type: image/png" );

imagepng ( $i, $saveto );



RETURN;



}





?>