diff options
author | zotlabs <mike@macgirvin.com> | 2018-06-26 17:19:32 -0700 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2018-06-26 17:19:32 -0700 |
commit | 156010050c874eb51f8d2b2334d36909f99e732c (patch) | |
tree | 1aae6de1e8bd990ebe911300b7cefe8d975e5059 | |
parent | 524551a05c9ea7436afc713e2564aacd9276541e (diff) | |
download | volse-hubzilla-156010050c874eb51f8d2b2334d36909f99e732c.tar.gz volse-hubzilla-156010050c874eb51f8d2b2334d36909f99e732c.tar.bz2 volse-hubzilla-156010050c874eb51f8d2b2334d36909f99e732c.zip |
imagick converter: -thumbnail doesn't preserve exif, -resize does
-rw-r--r-- | Zotlabs/Module/Cover_photo.php | 2 | ||||
-rw-r--r-- | Zotlabs/Thumbs/Pdf.php | 2 | ||||
-rw-r--r-- | Zotlabs/Thumbs/Video.php | 2 | ||||
-rw-r--r-- | include/photos.php | 6 |
4 files changed, 6 insertions, 6 deletions
diff --git a/Zotlabs/Module/Cover_photo.php b/Zotlabs/Module/Cover_photo.php index 88fd4485d..b911ac991 100644 --- a/Zotlabs/Module/Cover_photo.php +++ b/Zotlabs/Module/Cover_photo.php @@ -95,7 +95,7 @@ class Cover_photo extends \Zotlabs\Web\Controller { $fname = dbunescbin($r[0]['content']); $tmp_name = $fname . '-001'; $newsize = photo_calculate_scale(array_merge(getimagesize($fname),['max' => $max_thumb])); - $cmd = $imagick_path . ' ' . escapeshellarg(PROJECT_BASE . '/' . $fname) . ' -thumbnail ' . $newsize . ' ' . escapeshellarg(PROJECT_BASE . '/' . $tmp_name); + $cmd = $imagick_path . ' ' . escapeshellarg(PROJECT_BASE . '/' . $fname) . ' -resize ' . $newsize . ' ' . escapeshellarg(PROJECT_BASE . '/' . $tmp_name); // logger('imagick thumbnail command: ' . $cmd); for($x = 0; $x < 4; $x ++) { exec($cmd); diff --git a/Zotlabs/Thumbs/Pdf.php b/Zotlabs/Thumbs/Pdf.php index 98bcf11b5..11714ad53 100644 --- a/Zotlabs/Thumbs/Pdf.php +++ b/Zotlabs/Thumbs/Pdf.php @@ -27,7 +27,7 @@ class Pdf { $imagick_path = get_config('system','imagick_convert_path'); if($imagick_path && @file_exists($imagick_path)) { - $cmd = $imagick_path . ' ' . escapeshellarg(PROJECT_BASE . '/' . $tmpfile . '[0]') . ' -thumbnail ' . $width . 'x' . $height . ' ' . escapeshellarg(PROJECT_BASE . '/' . $outfile); + $cmd = $imagick_path . ' ' . escapeshellarg(PROJECT_BASE . '/' . $tmpfile . '[0]') . ' -resize ' . $width . 'x' . $height . ' ' . escapeshellarg(PROJECT_BASE . '/' . $outfile); // logger('imagick thumbnail command: ' . $cmd); for($x = 0; $x < 4; $x ++) { exec($cmd); diff --git a/Zotlabs/Thumbs/Video.php b/Zotlabs/Thumbs/Video.php index ff4d10a36..15d3ace12 100644 --- a/Zotlabs/Thumbs/Video.php +++ b/Zotlabs/Thumbs/Video.php @@ -46,7 +46,7 @@ class Video { $imagick_path = get_config('system','imagick_convert_path'); if($imagick_path && @file_exists($imagick_path)) { - $cmd = $imagick_path . ' ' . escapeshellarg(PROJECT_BASE . '/' . $tmpfile . '[0]') . ' -thumbnail ' . $width . 'x' . $height . ' ' . escapeshellarg(PROJECT_BASE . '/' . $outfile); + $cmd = $imagick_path . ' ' . escapeshellarg(PROJECT_BASE . '/' . $tmpfile . '[0]') . ' -resize ' . $width . 'x' . $height . ' ' . escapeshellarg(PROJECT_BASE . '/' . $outfile); // logger('imagick thumbnail command: ' . $cmd); /** @scrutinizer ignore-unhandled */ diff --git a/include/photos.php b/include/photos.php index 9fb872700..d0c5f77fc 100644 --- a/include/photos.php +++ b/include/photos.php @@ -80,8 +80,8 @@ function photo_upload($channel, $observer, $args) { if($imagick_path && @file_exists($imagick_path)) { $tmp_name = $args['os_syspath'] . '-001'; $newsize = photo_calculate_scale(array_merge($args['getimagesize'],['max' => $max_thumb])); - $cmd = $imagick_path . ' ' . escapeshellarg(PROJECT_BASE . '/' . $args['os_syspath']) . ' -thumbnail ' . $newsize . ' ' . escapeshellarg(PROJECT_BASE . '/' . $tmp_name); - // logger('imagick thumbnail command: ' . $cmd); + $cmd = $imagick_path . ' ' . escapeshellarg(PROJECT_BASE . '/' . $args['os_syspath']) . ' -resize ' . $newsize . ' ' . escapeshellarg(PROJECT_BASE . '/' . $tmp_name); + logger('imagick thumbnail command: ' . $cmd); for($x = 0; $x < 4; $x ++) { exec($cmd); if(file_exists($tmp_name)) { @@ -97,7 +97,7 @@ function photo_upload($channel, $observer, $args) { $imagedata = @file_get_contents($tmp_name); $filesize = @filesize($args['os_syspath']); - @unlink($tmp_name); +// @unlink($tmp_name); } else { $imagedata = @file_get_contents($args['os_syspath']); |