diff options
author | Bharat Mediratta <bharat@menalto.com> | 2009-05-20 04:25:10 +0000 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2009-05-20 04:25:10 +0000 |
commit | dc3df4d6ac0f976f4887a244d5fbbb153a991d90 (patch) | |
tree | 49158addffe14adf0ea85f3a08c8556b9b14997c /modules | |
parent | 0536025ff689d05711a40fcd255ee625904bbddb (diff) |
Don't import non-viewable image types (eg: psd). Swap in a broken
image instead so that we at least have a target for comments.
Fixes ticket #294
Diffstat (limited to 'modules')
-rw-r--r-- | modules/g2_import/helpers/g2_import.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/modules/g2_import/helpers/g2_import.php b/modules/g2_import/helpers/g2_import.php index 90f39ec1..d035e004 100644 --- a/modules/g2_import/helpers/g2_import.php +++ b/modules/g2_import/helpers/g2_import.php @@ -339,6 +339,11 @@ class g2_import_Core { switch ($g2_type) { case "GalleryPhotoItem": + if (!in_array($g2_item->getMimeType(), array("image/jpeg", "image/gif", "image/png"))) { + $g2_path = MODPATH . "g2_import/data/broken-image.gif"; + Kohana::log("alert", "$g2_path unsupported image type; using a placeholder gif"); + $corrupt = 1; + } $item = photo::create( $parent, $g2_path, @@ -378,7 +383,7 @@ class g2_import_Core { $url_generator = $GLOBALS["gallery"]->getUrlGenerator(); // @todo we need a more persistent $warning = - t("<a href=\"%g2_url\">%title</a> corrupt in Gallery 2; " . + 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" => $url_generator->generateUrl(array("itemId" => $g2_item->getId())), "g3_url" => $item->url(), |