Make WordPress Core

Opened 18 months ago

Last modified 18 months ago

#63322 new defect (bug)

Suggested cropping for media

Reported by: happyhobo Owned by:
Priority: normal Milestone: Awaiting Review
Component: Media Version: 6.8
Severity: minor Keywords:
Cc: Focuses: ui

Description

After uploading an image and entering metadata, the select and crop screen suggests 900 by 200 as optimal and marks that as the default.  But for header images what actually fits in my site is 1000 wide, and any height.  So I always have to skip cropping for headers. If I were to accidentally hit the return key, I would hae to delete and upload again.

Change History (1)

#1 @khushipatel15
18 months ago

You can add this in your functions.php

function add_suggested_crop_button() {
    echo '<button id="suggested-crop-button">Suggested Crop</button>';
}
add_action('media_buttons', 'add_suggested_crop_button');
function handle_suggested_crop() {
    // Perform image analysis and return suggested crop data
}
add_action('wp_ajax_crop_image', 'handle_suggested_crop');
Note: See TracTickets for help on using tickets.