summaryrefslogtreecommitdiff
path: root/inc/image.php
diff options
context:
space:
mode:
authorMichael Foster <savetheinternet@tinyboard.org>2013-07-21 15:50:45 -0400
committerMichael Foster <savetheinternet@tinyboard.org>2013-07-21 15:50:45 -0400
commit308f557fd503898406d7cb54ef7e6e6efb0f84ae (patch)
treec42fa4b237309168d895aa72d60e3b1b40ffeeac /inc/image.php
parente8b693b0447e5a61f740b27c5f3a57f68d544342 (diff)
Option to automatically strip EXIF metadata from JPEGs
Diffstat (limited to 'inc/image.php')
-rw-r--r--inc/image.php12
1 files changed, 10 insertions, 2 deletions
diff --git a/inc/image.php b/inc/image.php
index abe27bcb..eb98ceda 100644
--- a/inc/image.php
+++ b/inc/image.php
@@ -166,6 +166,9 @@ class ImageImagick extends ImageBase {
}
}
public function to($src) {
+ if ($config['strip_exif']) {
+ $this->image->stripImage();
+ }
if (preg_match('/\.gif$/i', $src))
$this->image->writeImages($src, true);
else
@@ -236,9 +239,14 @@ class ImageConvert extends ImageBase {
}
}
public function to($src) {
+ global $config;
+
if (!$this->temp) {
- // $config['redraw_image']
- shell_exec('convert ' . escapeshellarg($this->src) . ' ' . escapeshellarg($src));
+ if ($config['strip_exif']) {
+ shell_exec('convert ' . escapeshellarg($this->src) . ' -strip ' . escapeshellarg($src));
+ } else {
+ shell_exec('convert ' . escapeshellarg($this->src) . ' ' . escapeshellarg($src));
+ }
} else {
rename($this->temp, $src);
chmod($src, 0664);