summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-05-12 02:12:39 +0000
committerBharat Mediratta <bharat@menalto.com>2009-05-12 02:12:39 +0000
commit61ad68f1e6e77196ac28bca0c57441f0c38ef90b (patch)
treee4db0bb3c68870cb37dbd6afc1714c47c50b7369
parent5dbe1e59d88f1fdbf301c70176b3ea3702ba0adf (diff)
Deal gracefully with the case that the Gallery 2 instance didn't have
any resizes (or thumbnails). Fix a case where we were over-weighting the max dimension for square resizes and thumbs.
-rw-r--r--modules/g2_import/helpers/g2_import.php2
-rw-r--r--modules/g2_import/views/admin_g2_import.html.php4
2 files changed, 3 insertions, 3 deletions
diff --git a/modules/g2_import/helpers/g2_import.php b/modules/g2_import/helpers/g2_import.php
index 3ba37c86..c6ea2cc8 100644
--- a/modules/g2_import/helpers/g2_import.php
+++ b/modules/g2_import/helpers/g2_import.php
@@ -414,7 +414,7 @@ class g2_import_Core {
"FROM [GalleryDerivativeImage], [GalleryDerivative] " .
"WHERE [GalleryDerivativeImage::id] = [GalleryDerivative::id] " .
" AND [GalleryDerivative::derivativeType] = ? " .
- " AND [GalleryDerivativeImage::height] >= [GalleryDerivativeImage::width] " .
+ " AND [GalleryDerivativeImage::height] > [GalleryDerivativeImage::width] " .
"GROUP BY [GalleryDerivativeImage::height] " .
"ORDER by c DESC",
array($g2_enum),
diff --git a/modules/g2_import/views/admin_g2_import.html.php b/modules/g2_import/views/admin_g2_import.html.php
index 838e3a45..8b6d069e 100644
--- a/modules/g2_import/views/admin_g2_import.html.php
+++ b/modules/g2_import/views/admin_g2_import.html.php
@@ -43,7 +43,7 @@
</ul>
</div>
- <? if ($thumb_size != $g2_sizes["thumb"]["size"]): ?>
+ <? if ($g2_sizes["thumb"]["size"] && $thumb_size != $g2_sizes["thumb"]["size"]): ?>
<div class="gWarning">
<?= t("Your most common thumbnail size in Gallery 2 is %g2_pixels pixels, but your Gallery 3 thumbnail size is set to %g3_pixels pixels. <a href=\"%url\">Using the same value</a> will speed up your import.",
array("g2_pixels" => $g2_sizes["thumb"]["size"],
@@ -52,7 +52,7 @@
</div>
<? endif ?>
- <? if ($resize_size != $g2_sizes["resize"]["size"]): ?>
+ <? if ($g2_sizes["resize"]["size"] && $resize_size != $g2_sizes["resize"]["size"]): ?>
<div class="gWarning">
<?= t("Your most common intermediate size in Gallery 2 is %g2_pixels pixels, but your Gallery 3 thumbnail size is set to %g3_pixels pixels. <a href=\"%url\">Using the same value</a> will speed up your import.",
array("g2_pixels" => $g2_sizes["resize"]["size"],