Ignore:
Timestamp:
Dec 27, 2011, 6:26:44 AM (12 years ago)
Author:
rvelices
Message:

feature 2541 multisize

  • core implementation + usage on most public/admin pages
  • still to do: sync process, upload, gui/persistence for size parameters, migration script, center of interest ...
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/calendar_monthly.class.php

    r12118 r12796  
    351351    $page['chronology_date'][CDAY]=$day;
    352352    $query = '
    353 SELECT id, file,tn_ext,path, width, height, '.pwg_db_get_dayofweek($this->date_field).'-1 as dow';
     353SELECT id, file,representative_ext,path,width, height, '.pwg_db_get_dayofweek($this->date_field).'-1 as dow';
    354354    $query.= $this->inner_sql;
    355355    $query.= $this->get_date_where();
     
    360360
    361361    $row = pwg_db_fetch_assoc(pwg_query($query));
    362     $items[$day]['tn_url'] = get_thumbnail_url($row);
     362    $derivative = new DerivativeImage(IMG_SQUARE, new SrcImage($row));
     363    $items[$day]['derivative'] = $derivative;
    363364    $items[$day]['file'] = $row['file'];
    364     $items[$day]['path'] = $row['path'];
    365     $items[$day]['tn_ext'] = @$row['tn_ext'];
    366     $items[$day]['width'] = $row['width'];
    367     $items[$day]['height'] = $row['height'];
    368365    $items[$day]['dow'] = $row['dow'];
    369366  }
    370367
    371   if ( !empty($items)
    372       and $conf['calendar_month_cell_width']>0
    373       and $conf['calendar_month_cell_height']>0)
     368  if ( !empty($items) )
    374369  {
    375370    list($known_day) = array_keys($items);
     
    397392    }
    398393
    399     $cell_width = $conf['calendar_month_cell_width'];
    400     $cell_height = $conf['calendar_month_cell_height'];
     394    list($cell_width, $cell_height) = ImageStdParams::get_by_type(IMG_SQUARE)->sizing->ideal_size;
    401395
    402396    $tpl_weeks    = array();
     
    431425      else
    432426      {
    433         $thumb = get_thumbnail_path($items[$day]);
    434         $tn_size = @getimagesize($thumb);
    435 
    436         $tn_width = $tn_size[0];
    437         $tn_height = $tn_size[1];
     427        list($tn_width,$tn_height) = $items[$day]['derivative']->get_size();
    438428
    439429        // now need to fit the thumbnail of size tn_size within
     
    492482              'DOW'         => $dow,
    493483              'NB_ELEMENTS' => $items[$day]['nb_images'],
    494               'IMAGE'       => $items[$day]['tn_url'],
     484              'IMAGE'       => $items[$day]['derivative']->get_url(),
    495485              'U_IMG_LINK'  => $url,
    496486              'IMAGE_STYLE' => $css_style,
Note: See TracChangeset for help on using the changeset viewer.