From fbcb01caca780bb9507d554cf84c6e7e093c3a24 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sun, 10 May 2009 21:46:58 +0000 Subject: Only run copy_matching_thumbnails_and_resizes() when we're doing an import, else it interferes with thumbnail/resize generation during regular imports --- modules/g2_import/helpers/g2_import.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'modules/g2_import/helpers') diff --git a/modules/g2_import/helpers/g2_import.php b/modules/g2_import/helpers/g2_import.php index 8b716a60..8c9b9eb9 100644 --- a/modules/g2_import/helpers/g2_import.php +++ b/modules/g2_import/helpers/g2_import.php @@ -269,11 +269,18 @@ class g2_import_Core { if (isset($item)) { self::set_map($g2_item_id, $item->id); } + + self::$current_g2_item = null; } // If the thumbnails and resizes created for the Gallery2 photo match the dimensions of the // ones we expect to create for Gallery3, then copy the files over instead of recreating them. static function copy_matching_thumbnails_and_resizes($item) { + // We only operate on items that are being imported + if (empty(self::$current_g2_item)) { + return; + } + // Precaution: if the Gallery2 item was watermarked, or we have the Gallery3 watermark module // active then we'd have to do something a lot more sophisticated here. For now, just skip // this step in those cases. -- cgit v1.2.3