Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure we use the largest image size possible when scanning from the single edit view #235

Merged
merged 2 commits into from
Oct 19, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion includes/Classifai/Providers/Azure/ComputerVision.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,12 @@ public function attachment_data_meta_box( $post ) {
* @param int $attachment_id Post id for the attachment
*/
public function maybe_rescan_image( $attachment_id ) {
$image_url = wp_get_attachment_image_url( $attachment_id );
$metadata = wp_get_attachment_metadata( $attachment_id );
$image_url = get_largest_acceptable_image_url(
get_attached_file( $attachment_id ),
wp_get_attachment_url( $attachment_id ),
$metadata['sizes']
);
$image_scan = $this->scan_image( $image_url );
if ( ! is_wp_error( $image_scan ) ) {
// Are we updating the captions?
Expand Down