﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc
19679	Quicker image compression	mariusmandal		"When uploading a 8MB photo, WP used 12 seconds to compress the image to 4 sizes. After a quick mod, it uses 4 seconds to do the same job, without any noticable image quality loss (even though there is a small theoretical one)

Shortly put:
Sort sizes by area from large to small, and always create <this size> from the last image.
(the image size sorting might be done better, without me knowing how to at the moment..)

Why not do it like this? :)

My modifications to wp-admin/includes/image.php, replacing line 122-128 :

{{{
foreach($sizes as $size => $info) {
	$newsizes[ $info['width']*$info['height'] ] = $info;
	$sizename[ $info['width']*$info['height'] ] = $size;
}
krsort($newsizes);
foreach($newsizes as $res => $info)
	$sizes[$sizename[$res]] = $info;

$sizes = apply_filters( 'intermediate_image_sizes_advanced', $sizes );

foreach ($sizes as $size => $size_data ) {
	$resized = image_make_intermediate_size( $file, $size_data['width'], $size_data['height'], $size_data['crop'] );
	if ( $resized ) {
		$metadata['sizes'][$size] = $resized;
		$file = str_replace(substr($file, strrpos($file,'.')),
				'-'.$resized['width'].'x'.$resized['height'].substr($file, strrpos($file,'.')),
				$file);
	}
}
}}}
"	enhancement	closed	normal		Media	3.3	normal	wontfix	has-patch close	
