Show
Ignore:
Timestamp:
10/03/08 01:07:01 (14 months ago)
Author:
bchoate
Message:

Merging fireball branch changes to-date to trunk: svn merge -r2974:3081 http://code.sixapart.com/svn/movabletype/branches/fireball .

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/php/lib/thumbnail_lib.php

    r2691 r3082  
    5656    } 
    5757 
    58     function _make_dest_name ($w, $h, $format, $dest_type) { 
     58    function _make_dest_name ($w, $h, $format, $dest_type, $id) { 
    5959        $output = $this->src_type; 
    6060        if ($dest_type != 'auto') { 
     
    8282        $patterns[1] = '/%h/'; 
    8383        $patterns[2] = '/%f/'; 
    84         $patterns[3] = '/%x/'; 
     84        $patterns[3] = '/%i/'; 
     85        $patterns[4] = '/%x/'; 
    8586        $replacement[0] = $w; 
    8687        $replacement[1] = $h; 
    8788        $replacement[2] = $basename; 
    88         $replacement[3] = $ext; 
     89        $replacement[3] = $id; 
     90        $replacement[4] = $ext; 
    8991 
    9092        return preg_replace($patterns, $replacement, $format); 
     
    9294 
    9395    # Load or generate a thumbnail. 
    94     function get_thumbnail (&$dest, &$width, &$height, $scale = 0, $format = '%f-thumb-%wx%h%x', $dest_type = 'auto') { 
     96    function get_thumbnail (&$dest, &$width, &$height, $id, $scale = 0, $format = '%f-thumb-%wx%h-%i%x', $dest_type = 'auto') { 
    9597        if (empty($this->src_file)) return false; 
    9698        if (!file_exists($this->src_file)) return false; 
     
    130132        # Decide a destination file name 
    131133        if (empty($dest)) { 
    132             $dest = $this->_make_dest_name($thumb_w_name, $thumb_h_name, $format, $dest_type); 
     134            $dest = $this->_make_dest_name($thumb_w_name, $thumb_h_name, $format, $dest_type, $id); 
    133135        } 
    134136