Make WordPress Core

Opened 5 years ago

Last modified 5 years ago

#48712 new defect (bug)

For large images, wp_generate_attachment_metadata is breaking WordPress

Reported by: coderevolution's profile coderevolution Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 5.3
Component: Media Keywords:
Focuses: Cc:

Description (last modified by SergeyBiryukov)

I have this code in a custom plugin of mine:

    $screens_attach_id = wp_insert_attachment( $attachment, $file );
    require_once( ABSPATH . 'wp-admin/includes/image.php' );
    $attach_data = wp_generate_attachment_metadata( $screens_attach_id, $file );
    wp_update_attachment_metadata( $screens_attach_id, $attach_data );

It worked until now, however, in the current version, wp_generate_attachment_metadata is breaking execution without any error in any log, when called for some (large?) images. Example image: https://i.ibb.co/k1FVrCh/apex-jpg5dd30be89f32b-1024x603.jpg

Change History (2)

#1 @SergeyBiryukov
5 years ago

  • Component changed from General to Media
  • Description modified (diff)

This ticket was mentioned in Slack in #core-media by antpb. View the logs.


5 years ago

Note: See TracTickets for help on using tickets.