summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorczaks <marcin@6irc.net>2014-01-04 19:09:30 +0100
committerczaks <marcin@6irc.net>2014-01-04 19:09:30 +0100
commit9a5f3b2e31a00d13a8ae5320720d8a26976debc0 (patch)
tree2898db66f9ecc573cdf55a1e1070464d596b9c2e
parent4202e8123deb8485b64c3ff9ef65e8f5b8c29b24 (diff)
image resizing: fix a problem with some pngs; reported by urban
-rw-r--r--inc/image.php12
1 files changed, 8 insertions, 4 deletions
diff --git a/inc/image.php b/inc/image.php
index 1d591c25..9bb44414 100644
--- a/inc/image.php
+++ b/inc/image.php
@@ -338,8 +338,10 @@ class ImageConvert extends ImageBase {
$this->width,
$this->height,
escapeshellarg($this->temp)))) || !file_exists($this->temp)) {
- $this->destroy();
- error('Failed to resize image!', null, $error);
+ if (!preg_match ('/sBIT: invalid/', $error)) {
+ $this->destroy();
+ error('Failed to resize image!', null, $error);
+ }
}
if ($size = $this->get_size($this->temp)) {
$this->width = $size[0];
@@ -361,8 +363,10 @@ class ImageConvert extends ImageBase {
$this->width,
$this->height,
escapeshellarg($this->temp)))) || !file_exists($this->temp)) {
- $this->destroy();
- error('Failed to resize image!', null, $error);
+ if (!preg_match ('/sBIT: invalid/', $error)) {
+ $this->destroy();
+ error('Failed to resize image!', null, $error);
+ }
}
if ($size = $this->get_size($this->temp)) {
$this->width = $size[0];