From 360fbda04c8882efa053171ffb07fd76efaac940 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Tue, 23 Dec 2008 04:46:13 +0000 Subject: Only clear the dirty bit if we updated the specific target. --- core/helpers/graphics.php | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'core/helpers') diff --git a/core/helpers/graphics.php b/core/helpers/graphics.php index b38515fb..708b7bce 100644 --- a/core/helpers/graphics.php +++ b/core/helpers/graphics.php @@ -74,7 +74,7 @@ class graphics_Core { if ($item->thumb_dirty) { $ops["thumb"] = $item->thumb_path(); } - if ($item->resize_dirty) { + if ($item->resize_dirty && $item->type != "album") { $ops["resize"] = $item->resize_path(); } @@ -93,15 +93,19 @@ class graphics_Core { } } - $dims = getimagesize($item->thumb_path()); - $item->thumb_width = $dims[0]; - $item->thumb_height = $dims[1]; - $item->thumb_dirty = 0; + if (!empty($ops["thumb"])) { + $dims = getimagesize($item->thumb_path()); + $item->thumb_width = $dims[0]; + $item->thumb_height = $dims[1]; + $item->thumb_dirty = 0; + } - $dims = getimagesize($item->resize_path()); - $item->resize_width = $dims[0]; - $item->resize_height = $dims[1]; - $item->resize_dirty = 0; + if (!empty($ops["resize"])) { + $dims = getimagesize($item->resize_path()); + $item->resize_width = $dims[0]; + $item->resize_height = $dims[1]; + $item->resize_dirty = 0; + } $item->save(); } -- cgit v1.2.3