summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMacil Tech <maciltech@gmail.com>2012-07-19 00:16:50 -0600
committerMacil Tech <maciltech@gmail.com>2013-01-19 00:39:29 -0600
commit67ab3760baf43061d68b9480ed2e651b7b6566ae (patch)
tree82ab881da20f25c336221b23de39dc77121d9c6f
parentf2d3e45fd3b21758fd12c0c4a23ce272cca18026 (diff)
Removed redundant code in image processing.
Both paths of the code here did the same thing.
-rw-r--r--post.php34
1 files changed, 6 insertions, 28 deletions
diff --git a/post.php b/post.php
index 16566b51..1153b46a 100644
--- a/post.php
+++ b/post.php
@@ -407,34 +407,12 @@ if (isset($_POST['delete'])) {
require_once 'inc/image.php';
- if ($config['thumb_method'] == 'imagick') {
- // This is tricky, because Imagick won't let us find
- // an image's dimensions without loading it all into
- // memory first, unlike GD which provides the
- // getimagesize() to do exactly that. This section
- // is why GD is required, even when using Imagick
- // instead. There doesn't seem to be an alternative.
- // Necessary for security, as Imagick even ignores
- // PHP's memory limit.
-
- // first try GD's getimagesize()
- if ($size = @getimagesize($upload)) {
- if ($size[0] > $config['max_width'] || $size[1] > $config['max_height']) {
-
- error($config['error']['maxsize']);
- }
- } else {
- // GD failed
- // TODO?
- }
- } else {
- // find dimensions of an image using GD
- if (!$size = @getimagesize($upload)) {
- error($config['error']['invalidimg']);
- }
- if ($size[0] > $config['max_width'] || $size[1] > $config['max_height']) {
- error($config['error']['maxsize']);
- }
+ // find dimensions of an image using GD
+ if (!$size = @getimagesize($upload)) {
+ error($config['error']['invalidimg']);
+ }
+ if ($size[0] > $config['max_width'] || $size[1] > $config['max_height']) {
+ error($config['error']['maxsize']);
}
// create image object