-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathformProcess.php
More file actions
executable file
·50 lines (42 loc) · 1.1 KB
/
formProcess.php
File metadata and controls
executable file
·50 lines (42 loc) · 1.1 KB
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
47
48
49
50
<?php
/**
* @package phpPhotosMerger
* @author Bruno Trombi <bruno.trombi@gmail.com>
* @copyright 2014 Bruno Trombi
* @license http://www.gnu.org/licenses/gpl-3.0.txt
*
*process the uploaded files
**/
/*
* process the files uploaded in the form
* in case of error, return a minimal feedback to user
* otherwise call hideMovingObjects that create an imaged
* and return the image to the user.
*/
require('libUpload.php');
require('libImageMovingObjectsRemove.php');
$accepted= array();
$errors= array();
$r=uploadedFilesManage( $accepted, $errors ,300 );
if( empty( $errors ) )
{
//merge the image, removing pixel that are not common on most of images;
$gd=hideMovingObjects( $accepted );
//set the header properly
header('Content-Type: image/jpeg');
//imagejpeg($gd,'last.jpg');
imagejpeg($gd);
}
else //give a minum of feedback on files skipped
{
echo "<html><body>";
foreach( $errors as $errorFile )
{
echo "<br>" .$errorFile["name"] ." <br> errors: " ;
foreach( $errorFile["error_msg"] as $msg )
echo "<br>$msg";
echo "<hr>";
}
echo "</body></html>";
}
?>