diff options
author | Chad Kieffer <ckieffer@gmail.com> | 2009-06-09 00:26:01 -0600 |
---|---|---|
committer | Chad Kieffer <ckieffer@gmail.com> | 2009-06-09 00:26:01 -0600 |
commit | a42c101c0b76edb403f2f9c646c27539b983394b (patch) | |
tree | 833c42c308aa5eca8a0469a67b723936e33a81f9 /modules/g2_import/helpers | |
parent | d2b8ca241d6b2a1c1a512c731721b738e719d613 (diff) | |
parent | e6768a4e9771f5f751d74001ce3a0d33f6775216 (diff) |
Merge branch 'master' of git@github.com:gallery/gallery3
Diffstat (limited to 'modules/g2_import/helpers')
-rw-r--r-- | modules/g2_import/helpers/g2_import.php | 38 |
1 files changed, 25 insertions, 13 deletions
diff --git a/modules/g2_import/helpers/g2_import.php b/modules/g2_import/helpers/g2_import.php index 51dc8705..a6c21489 100644 --- a/modules/g2_import/helpers/g2_import.php +++ b/modules/g2_import/helpers/g2_import.php @@ -407,13 +407,19 @@ class g2_import_Core { Kohana::log("alert", "$g2_path unsupported image type; using a placeholder gif"); $corrupt = 1; } - $item = photo::create( - $parent, - $g2_path, - $g2_item->getPathComponent(), - $g2_item->getTitle(), - self::extract_description($g2_item), - self::map($g2_item->getOwnerId())); + try { + $item = photo::create( + $parent, + $g2_path, + $g2_item->getPathComponent(), + $g2_item->getTitle(), + self::extract_description($g2_item), + self::map($g2_item->getOwnerId())); + } catch (Exception $e) { + Kohana::log("alert", "Corrupt image $g2_path\n" . + $e->getMessage() . "\n" . $e->getTraceAsString()); + $corrupt = 1; + } break; case "GalleryMovieItem": @@ -449,12 +455,18 @@ class g2_import_Core { // Why oh why did I ever approve the session id placeholder idea in G2? $g2_item_url = str_replace('&g2_GALLERYSID=TMP_SESSION_ID_DI_NOISSES_PMT', '', $g2_item_url); - $warning = - t("<a href=\"%g2_url\">%title</a> from Gallery 2 could not be processed; " . - "(imported as <a href=\"%g3_url\">%title</a>)", - array("g2_url" => $g2_item_url, - "g3_url" => $item->url(), - "title" => $g2_item->getTitle())); + if (!empty($item)) { + $warning = + t("<a href=\"%g2_url\">%title</a> from Gallery 2 could not be processed; " . + "(imported as <a href=\"%g3_url\">%title</a>)", + array("g2_url" => $g2_item_url, + "g3_url" => $item->url(), + "title" => $g2_item->getTitle())); + } else { + $warning = + t("<a href=\"%g2_url\">%title</a> from Gallery 2 could not be processed", + array("g2_url" => $g2_item_url, "title" => $g2_item->getTitle())); + } message::warning($warning); log::warning("g2_import", $warning); Kohana::log("alert", $warning); |