summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-05-10 04:04:33 +0000
committerBharat Mediratta <bharat@menalto.com>2009-05-10 04:04:33 +0000
commite6d3d42c225ab37c1d1bae80649b6561be894046 (patch)
tree6c21c36009dc9dea7b065d834fb2c4ba3c639956
parent0872cce1ea218865230f3f0f09d2fbcb6895205f (diff)
Make the code that copies g2 derivatives more robust if the g2 data file doesn't exist.
-rw-r--r--modules/g2_import/helpers/g2_import.php18
1 files changed, 10 insertions, 8 deletions
diff --git a/modules/g2_import/helpers/g2_import.php b/modules/g2_import/helpers/g2_import.php
index 93131929..b5e7dafe 100644
--- a/modules/g2_import/helpers/g2_import.php
+++ b/modules/g2_import/helpers/g2_import.php
@@ -303,20 +303,22 @@ class g2_import_Core {
$item->thumb_dirty &&
($derivative->getWidth() == $target_thumb_size ||
$derivative->getHeight() == $target_thumb_size)) {
- copy(g2($derivative->fetchPath()), $item->thumb_path());
- $item->thumb_height = $derivative->getHeight();
- $item->thumb_width = $derivative->getWidth();
- $item->thumb_dirty = false;
+ if (@copy(g2($derivative->fetchPath()), $item->thumb_path())) {
+ $item->thumb_height = $derivative->getHeight();
+ $item->thumb_width = $derivative->getWidth();
+ $item->thumb_dirty = false;
+ }
}
if ($derivative->getDerivativeType() == DERIVATIVE_TYPE_IMAGE_RESIZE &&
$item->resize_dirty &&
($derivative->getWidth() == $target_resize_size ||
$derivative->getHeight() == $target_resize_size)) {
- copy(g2($derivative->fetchPath()), $item->resize_path());
- $item->resize_height = $derivative->getHeight();
- $item->resize_width = $derivative->getWidth();
- $item->resize_dirty = false;
+ if (@copy(g2($derivative->fetchPath()), $item->resize_path())) {
+ $item->resize_height = $derivative->getHeight();
+ $item->resize_width = $derivative->getWidth();
+ $item->resize_dirty = false;
+ }
}
}
$item->save();