Hi there, I use this fonction in my template (buddypress) :
function replace_uploaded_image($image_data) {
if (!isset($image_data['sizes']['large'])) return $image_data;
$upload_dir = wp_upload_dir();
$uploaded_image_location = $upload_dir['basedir'] . '/' .$image_data['file'];
$large_image_location = $upload_dir['basedir'] . '/' . substr($image_data['file'], 0, 8) . $image_data['sizes']['large']['file'];
unlink($uploaded_image_location);
rename($large_image_location,$uploaded_image_location);
$image_data['width'] = $image_data['sizes']['large']['width'];
$image_data['height'] = $image_data['sizes']['large']['height'];
unset($image_data['sizes']['large']);
return $image_data;
}
add_filter('wp_generate_attachment_metadata','replace_uploaded_image');
The aim is to improve my server space storage. So I automaticaly delete full image and replace it by the large one. Everything works fine with all my functions and home-made plugins but not with rtmedia. :-(
I'm not sure, but I think it worked before the last update. Is it a hook problem ? In insert_attachment() you wrote a comment "FIX WORDPRESS 3.6 METADATA", and call media.php... At the begining I thaught it was the reason wy my filter was overriden, but I tried to remove it and there is no change.
Thanks.