Changeset 1677:61b034ed28a6
- Timestamp:
- 09/01/13 10:04:13 (11 years ago)
- Branch:
- 2.5
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
inc/core/class.dc.media.php
r1381 r1677 299 299 $f->media_thumb = array(); 300 300 $p = path::info($f->relname); 301 301 302 $alpha = ($p['extension'] == 'png') || ($p['extension'] == 'PNG'); 303 302 304 $thumb = sprintf(($alpha ? $this->thumb_tp_alpha : $this->thumb_tp),$this->root.'/'.$p['dirname'],$p['base'],'%s'); 303 305 $thumb_url = sprintf(($alpha ? $this->thumb_tp_alpha : $this->thumb_tp),$this->root_url.$p['dirname'],$p['base'],'%s'); … … 306 308 $thumb_url = preg_replace('#\./#','/',$thumb_url); 307 309 $thumb_url = preg_replace('#(?<!:)/+#','/',$thumb_url); 310 311 if ($alpha) { 312 $thumb_alt = sprintf($this->thumb_tp,$this->root.'/'.$p['dirname'],$p['base'],'%s'); 313 $thumb_url_alt = sprintf($this->thumb_tp,$this->root_url.$p['dirname'],$p['base'],'%s'); 314 # Cleaner URLs 315 $thumb_url_alt = preg_replace('#\./#','/',$thumb_url_alt); 316 $thumb_url_alt = preg_replace('#(?<!:)/+#','/',$thumb_url_alt); 317 } 308 318 309 319 foreach ($this->thumb_sizes as $suffix => $s) { 310 320 if (file_exists(sprintf($thumb,$suffix))) { 311 321 $f->media_thumb[$suffix] = sprintf($thumb_url,$suffix); 322 } elseif ($alpha && file_exists(sprintf($thumb_alt,$suffix))) { 323 $f->media_thumb[$suffix] = sprintf($thumb_url_alt,$suffix); 312 324 } 313 325 }
Note: See TracChangeset
for help on using the changeset viewer.