Changeset 24835
- Timestamp:
- Oct 10, 2013, 1:09:51 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/batch_manager.php
r24834 r24835 491 491 $result = pwg_query($query); 492 492 493 if (!pwg_db_num_rows($result)) 493 if (pwg_db_num_rows($result)) 494 { 495 while ($row = pwg_db_fetch_assoc($result)) 496 { 497 if ($row['width']>0 && $row['height']>0) 498 { 499 $widths[] = $row['width']; 500 $heights[] = $row['height']; 501 $ratios[] = floor($row['width'] / $row['height'] * 100) / 100; 502 } 503 } 504 } 505 if (empty($widths)) 494 506 { // arbitrary values, only used when no photos on the gallery 495 507 $widths = array(600, 1920, 3500); … … 497 509 $ratios = array(1.25, 1.52, 1.78); 498 510 } 499 else 500 { 501 while ($row = pwg_db_fetch_assoc($result)) 502 { 503 $widths[] = $row['width']; 504 $heights[] = $row['height']; 505 $ratios[] = floor($row['width'] * 100 / $row['height']) / 100; 506 } 507 } 511 508 512 509 513 … … 564 568 $dimensions['ratio_'.$ratio_category] = array( 565 569 'min' => $ratio_categories[$ratio_category][0], 566 'max' => $ratio_categories[$ratio_category][count($ratio_categories[$ratio_category]) - 1]570 'max' => array_pop($ratio_categories[$ratio_category]), 567 571 ); 568 572 }
Note: See TracChangeset
for help on using the changeset viewer.