WordPress resizes image to the same size as uploaded

If you are uploading images the same size as the large size in your WordPress installation, then set your Large size to 0x0 in Settings -> Media or remove this line:

add_image_size( 'large-size',  $LARGE_SIZE, 9999 );

EDIT #1:

Try to add this filter to delete the original image:

add_filter('wp_generate_attachment_metadata', 'delete_fullsize_image');
function delete_fullsize_image($metadata) {
    $upload_dir = wp_upload_dir();
    $full_image_path = trailingslashit($upload_dir['basedir']) . $metadata['file'];
    $deleted = unlink($full_image_path);

    return $metadata;
}

It will delete the original image after upload and keep only the generated ones.

EDIT #2:

Check these two plugins (untested), they might help you do it automatically:

Leave a Comment