Changeset 3082 for trunk/php/lib/thumbnail_lib.php
- Timestamp:
- 10/03/08 01:07:01 (14 months ago)
- Files:
-
- 1 modified
-
trunk/php/lib/thumbnail_lib.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/php/lib/thumbnail_lib.php
r2691 r3082 56 56 } 57 57 58 function _make_dest_name ($w, $h, $format, $dest_type ) {58 function _make_dest_name ($w, $h, $format, $dest_type, $id) { 59 59 $output = $this->src_type; 60 60 if ($dest_type != 'auto') { … … 82 82 $patterns[1] = '/%h/'; 83 83 $patterns[2] = '/%f/'; 84 $patterns[3] = '/%x/'; 84 $patterns[3] = '/%i/'; 85 $patterns[4] = '/%x/'; 85 86 $replacement[0] = $w; 86 87 $replacement[1] = $h; 87 88 $replacement[2] = $basename; 88 $replacement[3] = $ext; 89 $replacement[3] = $id; 90 $replacement[4] = $ext; 89 91 90 92 return preg_replace($patterns, $replacement, $format); … … 92 94 93 95 # 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') { 95 97 if (empty($this->src_file)) return false; 96 98 if (!file_exists($this->src_file)) return false; … … 130 132 # Decide a destination file name 131 133 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); 133 135 } 134 136
