Changeset 13038 for trunk/include
- Timestamp:
- Feb 6, 2012, 9:59:20 PM (12 years ago)
- Location:
- trunk/include
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/dblayer/functions_mysql.inc.php
r12922 r13038 85 85 global $conf,$page,$debug,$t2; 86 86 87 $start = get_moment();87 $start = microtime(true); 88 88 ($result = mysql_query($query)) or my_error($query, $conf['die_on_sql_error']); 89 89 90 $time = get_moment() - $start;90 $time = microtime(true) - $start; 91 91 92 92 if (!isset($page['count_queries'])) … … 200 200 while ($row = mysql_fetch_assoc($result)) 201 201 { 202 array_push($array, $row[$fieldname]);202 $array[] = $row[$fieldname]; 203 203 } 204 204 -
trunk/include/derivative.inc.php
r12954 r13038 28 28 public $rel_path; 29 29 30 public $coi=null;31 30 private $size=null; 32 31 private $flags=0; … … 35 34 { 36 35 global $conf; 37 36 38 37 $this->id = $infos['id']; 39 38 $ext = get_extension($infos['path']); … … 55 54 } 56 55 57 $this->coi = @$infos['coi'];58 56 if (!$this->size && isset($infos['width']) && isset($infos['height'])) 59 57 { … … 168 166 $tokens=array(); 169 167 $tokens[] = substr($params->type,0,2); 170 171 if ($params->sizing->max_crop != 0 and !empty($src->coi))172 {173 $tokens[] = 'ci'.$src->coi;174 }175 168 176 169 if ($params->type==IMG_CUSTOM) … … 258 251 return $this->src_image->get_size(); 259 252 } 260 return $this->params->compute_final_size($this->src_image->get_size() , $this->src_image->coi);253 return $this->params->compute_final_size($this->src_image->get_size()); 261 254 } 262 255 -
trunk/include/derivative_params.inc.php
r13035 r13038 46 46 function fraction_to_char($f) 47 47 { 48 return ord('a') + round($f*25);48 return chr(ord('a') + round($f*25)); 49 49 } 50 50 … … 258 258 } 259 259 260 function compute_final_size($in_size , $coi)261 { 262 $this->sizing->compute( $in_size, $coi, $crop_rect, $scale_size );260 function compute_final_size($in_size) 261 { 262 $this->sizing->compute( $in_size, null, $crop_rect, $scale_size ); 263 263 return $scale_size != null ? $scale_size : $in_size; 264 264 } -
trunk/include/derivative_std_params.inc.php
r13021 r13038 73 73 return self::$all_type_map[$type]; 74 74 } 75 75 76 76 static function get_custom($w, $h, $crop=0, $minw=null, $minh=null) 77 77 { … … 99 99 global $conf; 100 100 $arr = @unserialize($conf['derivatives']); 101 if (false!==$arr)102 {103 self::$type_map = $arr['d'];104 self::$watermark = @$arr['w'];105 if (!self::$watermark) self::$watermark = new WatermarkParams();106 }107 else108 {109 self::make_default();110 }111 self::build_maps();112 }113 114 static function load_from_file()115 {116 global $conf;117 $arr = @unserialize(@file_get_contents(PHPWG_ROOT_PATH.$conf['data_location'].'derivatives.dat'));118 101 if (false!==$arr) 119 102 { … … 131 114 } 132 115 116 static function load_from_file() 117 { 118 global $conf; 119 $arr = @unserialize(@file_get_contents(PHPWG_ROOT_PATH.$conf['data_location'].'derivatives.dat')); 120 if (false!==$arr) 121 { 122 self::$type_map = $arr['d']; 123 self::$watermark = @$arr['w']; 124 if (!self::$watermark) self::$watermark = new WatermarkParams(); 125 self::$custom = @$arr['c']; 126 if (!self::$custom) self::$custom = array(); 127 } 128 else 129 { 130 self::make_default(); 131 } 132 self::build_maps(); 133 } 134 133 135 static function set_watermark($watermark) 134 136 { 135 137 self::$watermark = $watermark; 136 138 } 137 139 138 140 static function set_and_save($map) 139 141 { … … 177 179 } 178 180 } 179 181 180 182 private static function build_maps() 181 183 {
Note: See TracChangeset
for help on using the changeset viewer.