Added PNG metadata-stripping
This commit is contained in:
parent
b2d80531e1
commit
5e58a61813
|
@ -30,7 +30,7 @@ switch (true) {
|
||||||
case (move_uploaded_file($_FILES["uploadcoin"]["tmp_name"], $dest_file)
|
case (move_uploaded_file($_FILES["uploadcoin"]["tmp_name"], $dest_file)
|
||||||
&& write_metadata($dest_file, $_POST["file_source"])):
|
&& write_metadata($dest_file, $_POST["file_source"])):
|
||||||
|
|
||||||
if (in_array(file_extension($dest_file),array("jpg","jpeg"))) {
|
if (is_image($dest_file)) {
|
||||||
sanitize_image($dest_file);
|
sanitize_image($dest_file);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,7 @@ $file_beam_dir = "p/"; // where the files go
|
||||||
|
|
||||||
|
|
||||||
// for sanitization of images (stripping EXIF, etc) with an external program.
|
// for sanitization of images (stripping EXIF, etc) with an external program.
|
||||||
$image_sanitize_command = "jhead";
|
$image_sanitize_command = "mogrify";
|
||||||
$image_sanitize_args = "-purejpg";
|
$image_sanitize_args = "-strip";
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -54,5 +54,18 @@ function file_extension($file_name)
|
||||||
return strtolower(pathinfo($file_name, PATHINFO_EXTENSION));
|
return strtolower(pathinfo($file_name, PATHINFO_EXTENSION));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// FILENAME --> BOOLEAN
|
||||||
|
// Return whether or not a filename has an 'image' file-extension
|
||||||
|
function is_image($file_name)
|
||||||
|
{
|
||||||
|
$file_ext = file_extension($file_name);
|
||||||
|
|
||||||
|
if (in_array(($file_ext), array("jpg", "jpeg", "jpg", "png"))) {
|
||||||
|
return 1;
|
||||||
|
} else {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
<div class="menu top-menu">
|
<div class="menu top-menu">
|
||||||
<h2><a href="/"><?php echo($GLOBALS["site_name"]); ?></a>
|
<h2><a href="/"><?php echo($GLOBALS["site_name"]); ?></a>
|
||||||
<img id="duck" src="/res/img/war_duck.png"></h2>
|
<img id="duck" src="/res/img/war_duck.png" alt="Warduck lives!">
|
||||||
|
</h2>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="/coin.php">file-beamer</a></li>
|
<li><a href="/coin.php">file-beamer</a></li>
|
||||||
<li><a href="/mask.php">url-shortener</a></li>
|
<li><a href="/mask.php">url-shortener</a></li>
|
||||||
|
|
Ŝarĝante…
Reference in New Issue