Add exams from exam156 to exam199
This commit is contained in:
29
exam161/generate.php
Executable file
29
exam161/generate.php
Executable file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
header('Content-type: image/jpeg');
|
||||
|
||||
if(isset($_GET['source'])){
|
||||
$source = $_GET['source'];
|
||||
|
||||
$watermark = imagecreatefrompng('php.png');
|
||||
|
||||
$watermark_height = imagesx($watermark);
|
||||
$watermark_width = imagesy($watermark); // imagesx uzima sirinu ucitane slike
|
||||
|
||||
// Ova funkcija stvara praznu sliku s određenom širinom i visinom, koristeći prave boje umesto indeksiranih
|
||||
$image = imagecreatetruecolor($watermark_width, $watermark_height);
|
||||
$image = imagecreatefromjpeg($source);
|
||||
|
||||
$image_size = getimagesize($source);
|
||||
$x = $image_size[0] - $watermark_width - 10;
|
||||
$y = $image_size[1] - $watermark_height - 10;
|
||||
|
||||
imagecopymerge($image,$watermark,$x,$y, 0, 0,$watermark_width,$watermark_height, 40);
|
||||
imagejpeg($image); // ili imagejpeg($image, $source.'.watermark.jp'); sto nam pravi sliku u folderu ako stavimo drugi parametar
|
||||
|
||||
|
||||
} else {
|
||||
echo 'No source suplied';
|
||||
}
|
||||
|
||||
?>
|
||||
1
exam161/index.php
Executable file
1
exam161/index.php
Executable file
@@ -0,0 +1 @@
|
||||
<img src="generate.php?source=phone2.jpg" />
|
||||
BIN
exam161/phone2.jpg
Executable file
BIN
exam161/phone2.jpg
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 122 KiB |
BIN
exam161/phone2.jpg.watermark.jpg
Normal file
BIN
exam161/phone2.jpg.watermark.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 116 KiB |
BIN
exam161/php.png
Normal file
BIN
exam161/php.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
Reference in New Issue
Block a user