summaryrefslogtreecommitdiff
path: root/inc/image.php
diff options
context:
space:
mode:
authorSimon McFarlane <simon@piston.pw>2015-06-01 16:08:19 -0700
committerSimon McFarlane <simon@piston.pw>2015-06-01 16:08:19 -0700
commit209bc5400144e448e95a68e01d842c6fab53ae71 (patch)
treeab4cc6ad241e8daccb546514330d3a5f2906e846 /inc/image.php
parentd1c1e5a589f30d640f5eb6303e7059105a6297f8 (diff)
parent7ab9cc43d101ed002bce392beefe1c435ab2d5b1 (diff)
Merge pull request #18 from lainchan/vichan-merge
Merge with the latest upstream vichan
Diffstat (limited to 'inc/image.php')
-rw-r--r--inc/image.php15
1 files changed, 11 insertions, 4 deletions
diff --git a/inc/image.php b/inc/image.php
index eb8eb79b..291f3e2a 100644
--- a/inc/image.php
+++ b/inc/image.php
@@ -330,6 +330,7 @@ class ImageConvert extends ImageBase {
$convert_args = str_replace('-auto-orient', '', $config['convert_args']);
else
$convert_args = &$config['convert_args'];
+
if (($error = shell_exec_error(($this->gm ? 'gm ' : '') . 'convert ' .
sprintf($convert_args,
$this->width,
@@ -361,10 +362,16 @@ class ImageConvert extends ImageBase {
$this->width,
$this->height,
escapeshellarg($this->temp)))) || !file_exists($this->temp)) {
- if (!file_exists($this->temp)) {
- $this->destroy();
- error(_('Failed to resize image!'), null, $error);
- }
+
+ if (strpos($error, "known incorrect sRGB profile") === false &&
+ strpos($error, "iCCP: Not recognizing known sRGB profile that has been edited") === false) {
+ $this->destroy();
+ error(_('Failed to resize image!')." "._('Details: ').nl2br(htmlspecialchars($error)), null, array('convert_error' => $error));
+ }
+ if (!file_exists($this->temp)) {
+ $this->destroy();
+ error(_('Failed to resize image!'), null, $error);
+ }
}
if ($size = $this->get_size($this->temp)) {
$this->width = $size[0];