diff options
| author | Simon McFarlane <simon@piston.pw> | 2015-05-26 23:31:47 -0700 |
|---|---|---|
| committer | Simon McFarlane <simon@piston.pw> | 2015-05-29 01:34:53 -0700 |
| commit | 4b40f69a4e6d190f6d342875bd084c2a6c9d8b0f (patch) | |
| tree | fcc5dc9efa24afcb0bda3740b59f0c4e81c42f62 /inc/image.php | |
| parent | 2ac451ecb7aaae1ed1402425b8df6a5cb9831f2b (diff) | |
| parent | d20149b57929c27da87a7d9603d85717da15c5bc (diff) | |
Merge remote-tracking branch 'upstream/master' into vichan-merge
Diffstat (limited to 'inc/image.php')
| -rw-r--r-- | inc/image.php | 15 |
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]; |
