summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJade Levesque <jadedctrl@teknik.io>2018-04-08 04:09:34 +0000
committerJade Levesque <jadedctrl@teknik.io>2018-04-08 04:09:34 +0000
commitdd8fde650e21fab2da7407264fe4bdbb68e8a38b (patch)
tree09eb4fa0643f188e345bf2dad62c472de6885afb
parent7f820c08fce4bfaeb44b71e7295af0924f7a15d0 (diff)
downloadinsert-coin-dd8fde650e21fab2da7407264fe4bdbb68e8a38b.zip
insert-coin-dd8fde650e21fab2da7407264fe4bdbb68e8a38b.tar.bz2
Fixed file path
-rw-r--r--beam.php6
-rw-r--r--lib.php13
2 files changed, 9 insertions, 10 deletions
diff --git a/beam.php b/beam.php
index 13332bd..785de38 100644
--- a/beam.php
+++ b/beam.php
@@ -60,7 +60,13 @@ switch ($beaming_permitted)
case 0:
if (move_uploaded_file($_FILES["fileToUpload"]["tmp_name"],$dest_file))
{
+// $file_ext = pathinfo($dest_file, PATHINFO_EXTENSION);
+// if ($file_ext == "jpg")
+// {
+// sanitize_image($dest_file);
+// }
write_metadata($dest_file, $_POST["file_source"]);
+
celebrate($dest_file, $file_beam_item,
$file_beam_win_img, $file_beam_win_alt, true);
}
diff --git a/lib.php b/lib.php
index 4ec99cb..ebfb71f 100644
--- a/lib.php
+++ b/lib.php
@@ -96,7 +96,7 @@ function get_cwd($url)
{
$parts = count($url_array);
- $url = implode(array_splice($url_array, 1, $parts - 2));
+ $url = $_SERVER["HTTP_HOST"] . implode(array_splice($url_array, 1, $parts - 2));
return $url;
}
@@ -106,16 +106,9 @@ function get_cwd($url)
}
}
-function sanitize_jpg($path)
+function sanitize_image($path)
{
- $image = new Imagick($path);
-
- $profiles = $image->getImageProfiles("icc", true);
-
- $image->Imagick::stripImage();
-
-if(!empty($profiles))
- $image->profileImage("icc", $profiles['icc']);
+ exec("mogrify -strip " . $path, $result);
}