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); }