PHP - Marca De Agua Para jpegcam

 
Vista:

Marca De Agua Para jpegcam

Publicado por david (1 intervención) el 11/06/2011 14:29:54
Hola alguien me podria ayudar a poner marca de agua alas imagenes que crea el flash cal capturar las imagenes en la pagina hay un codigo que dicen que depronto depronto serviria pero lo he probado y no sirve no se si estoy asiendo algo mal o que si alguien me podria ayudar

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<? function watermark($SourceFile?, $WatermarkFile?, $SaveToFile? = NULL)
 
{
 
$watermark = @imagecreatefrompng($WatermarkFile?)
or exit('Cannot open the watermark file.');
imageAlphaBlending($watermark, false);
imageSaveAlpha($watermark, true);
$image_string = @file_get_contents($SourceFile?)
or exit('Cannot open image file.');
$image = @imagecreatefromstring($image_string)
or exit('Not a valid image format.');
$imageWidth=imageSX($image);
$imageHeight=imageSY($image);
$watermarkWidth=imageSX($watermark);
$watermarkHeight=imageSY($watermark);
$coordinate_X = ( $imageWidth - 5) - ( $watermarkWidth);
$coordinate_Y = ( $imageHeight - 5) - ( $watermarkHeight);
imagecopy($image, $watermark, $coordinate_X, $coordinate_Y,
0, 0, $watermarkWidth, $watermarkHeight);
if(!($SaveToFile?)) header('Content-Type: image/jpeg');
imagejpeg ($image, $SaveToFile?, 100);
imagedestroy($image);
imagedestroy($watermark);
if(!($SaveToFile?)) exit;
}
 
And after
 
$result = file_put_contents( $filename, file_get_contents('php://input') ); if (!$result) {
 
print "ERROR: Failed to write data to $filename, check permissions\n";
exit(); }
This code:
 
// The image should be located in a non public directory
 
$image_location = 'dir/test.jpg';
 
// Locate the watermark file wherever you choose (remember PNG format)
 
$watermark_location = 'watermark.png';
 
// Watermark the image and send it to the browser
 
watermark($image_location, $watermark_location, $image_location);
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder