Changeset 19920


Ignore:
Timestamp:
Jan 6, 2013, 7:09:37 PM (11 years ago)
Author:
mistic100
Message:

feature:2718 errors when no photo on the gallery, use arbitrary values instead

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/batch_manager.php

    r19703 r19920  
    458458$result = pwg_query($query);
    459459
    460 while ($row = pwg_db_fetch_assoc($result))
    461 {
    462   $widths[] = $row['width'];
    463   $heights[] = $row['height'];
    464   $ratios[] = floor($row['width'] * 100 / $row['height']) / 100;
    465 }
     460if (!pwg_db_num_rows($result))
     461{ // arbitrary values, only used when no photos on the gallery
     462  $widths = array(600, 1920, 3500);
     463  $heights = array(480, 1080, 2300);
     464  $ratios = array(1.25, 1.52, 1.78);
     465}
     466else
     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}
     475
    466476
    467477$widths = array_unique($widths);
Note: See TracChangeset for help on using the changeset viewer.