Make WordPress Core

Opened 7 years ago

Closed 3 months ago

#48712 closed defect (bug) (invalid)

For large images, wp_generate_attachment_metadata is breaking WordPress

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

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 (3)

#1 @SergeyBiryukov
7 years ago

  • Component GeneralMedia
  • Description modified (diff)

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


7 years ago

#3 @nickchomey
3 months ago

  • Keywords close added
  • Resolutioninvalid
  • Status newclosed

I cant reproduce with that (very small) image. Also, error messages for similar situations seems to be tracked/worked on in https://core.trac.wordpress.org/ticket/22869

Note: See TracTickets for help on using tickets.