Browse code

Added EXIF data-stripping for JPEG files

Jenga Phoenix authored on 2019-01-27 05:55:01
Showing 2 changed files
... ...
@@ -21,12 +21,19 @@ switch (true) {
21 21
 	case (empty($file_name) || empty($dest_name)):
22 22
 		redirect(make_url("result/beam.php?error=1"));
23 23
 		break;
24
+
24 25
 	case (file_exists($dest_file)):
25 26
 		redirect(make_url("result/beam.php?error=2"));
26 27
 		break;
27 28
 
29
+
28 30
 	case (move_uploaded_file($_FILES["uploadcoin"]["tmp_name"], $dest_file)
29 31
 	&& write_metadata($dest_file, $_POST["file_source"])):
32
+
33
+		if (in_array(file_extension($dest_file)),array("jpg","jpeg")) {
34
+			sanitize_image($dest_file);
35
+		}
36
+
30 37
 		redirect(make_url("result/beam.php?success="
31 38
 				. $file_name));
32 39
 		break;
33 40
similarity index 95%
34 41
rename from resources/config.default.php
35 42
rename to resources/config.example.php
... ...
@@ -41,7 +41,7 @@ $file_beam_dir = "p/";		// where the files go
41 41
 
42 42
 
43 43
 // for sanitization of images (stripping EXIF, etc) with an external program.
44
-$image_sanitize_command = "mogrify";
45
-$image_sanitize_args = "strip";
44
+$image_sanitize_command = "jhead";
45
+$image_sanitize_args = "-purejpg";
46 46
 
47 47
 ?>