Changeset 452660
- Timestamp:
- 10/18/2011 10:54:49 PM (14 years ago)
- Location:
- wp-smushit/trunk
- Files:
-
- 2 edited
-
readme.txt (modified) (1 diff)
-
wp-smushit.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-smushit/trunk/readme.txt
r450734 r452660 1 1 === WP Smush.it === 2 2 Plugin Name: WP Smush.it 3 Version: 1.4. 23 Version: 1.4.3 4 4 Author: Dialect 5 5 Author URI: http://dialect.ca/?wp_smush_it -
wp-smushit/trunk/wp-smushit.php
r450014 r452660 2 2 /** 3 3 * Integrate the Smush.it API into WordPress. 4 * @version 1.4. 24 * @version 1.4.3 5 5 * @package WP_SmushIt 6 6 */ … … 10 10 Description: Reduce image file sizes and improve performance using the <a href="http://smush.it/">Smush.it</a> API within WordPress. 11 11 Author: Dialect 12 Version: 1.4. 212 Version: 1.4.3 13 13 Author URI: http://dialect.ca/ 14 14 */ … … 223 223 function wp_smushit_resize_from_meta_data($meta, $ID = null, $force_resmush = true) { 224 224 $file_path = $meta['file']; 225 225 226 $store_absolute_path = true; 226 227 $upload_dir = wp_upload_dir(); … … 235 236 if ( $force_resmush || wp_smushit_should_resmush( @$meta['wp_smushit'] ) ) { 236 237 list($file, $msg) = wp_smushit($file_path); 237 $meta['file'] = $file;238 238 $meta['wp_smushit'] = $msg; 239 239 } 240 241 240 242 241 // strip absolute path for Wordpress >= 2.6.2 243 242 if ( FALSE === $store_absolute_path ) { … … 250 249 251 250 // meta sizes don't contain a path, so we calculate one 252 $base_dir = dirname($file_path) . '/'; 253 251 $base_dir = trailingslashit( dirname($file_path) ); 254 252 255 253 foreach($meta['sizes'] as $size => $data) { … … 258 256 } 259 257 260 list($smushed_file, $results) = wp_smushit($base_dir . $data['file']); 261 $meta['sizes'][$size]['file'] = str_replace($base_dir, '', $smushed_file); 258 list($smushed_file, $results) = wp_smushit( $base_dir . wp_basename( $data['file'] ) ); 262 259 $meta['sizes'][$size]['wp_smushit'] = $results; 263 260 } 264 265 261 return $meta; 266 262 }
Note: See TracChangeset
for help on using the changeset viewer.