Changeset 24880 for branches/2.5/admin/batch_manager.php
- Timestamp:
- Oct 12, 2013, 10:53:45 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.5/admin/batch_manager.php
r19920 r24880 458 458 $result = pwg_query($query); 459 459 460 if (!pwg_db_num_rows($result)) 460 if (pwg_db_num_rows($result)) 461 { 462 while ($row = pwg_db_fetch_assoc($result)) 463 { 464 if ($row['width']>0 && $row['height']>0) 465 { 466 $widths[] = $row['width']; 467 $heights[] = $row['height']; 468 $ratios[] = floor($row['width'] / $row['height'] * 100) / 100; 469 } 470 } 471 } 472 if (empty($widths)) 461 473 { // arbitrary values, only used when no photos on the gallery 462 474 $widths = array(600, 1920, 3500); … … 464 476 $ratios = array(1.25, 1.52, 1.78); 465 477 } 466 else 467 { 468 while ($row = pwg_db_fetch_assoc($result)) 469 { 470 $widths[] = $row['width']; 471 $heights[] = $row['height']; 472 $ratios[] = floor($row['width'] * 100 / $row['height']) / 100; 473 } 474 } 478 475 479 476 480 … … 531 535 $dimensions['ratio_'.$ratio_category] = array( 532 536 'min' => $ratio_categories[$ratio_category][0], 533 'max' => $ratio_categories[$ratio_category][count($ratio_categories[$ratio_category]) - 1]537 'max' => array_pop($ratio_categories[$ratio_category]), 534 538 ); 535 539 }
Note: See TracChangeset
for help on using the changeset viewer.