[wp-trac] [WordPress Trac] #48712: For large images, wp_generate_attachment_metadata is breaking WordPress

WordPress Trac noreply at wordpress.org
Tue Nov 19 08:04:06 UTC 2019


#48712: For large images, wp_generate_attachment_metadata is breaking WordPress
----------------------------+------------------------------
 Reporter:  coderevolution  |       Owner:  (none)
     Type:  defect (bug)    |      Status:  new
 Priority:  normal          |   Milestone:  Awaiting Review
Component:  Media           |     Version:  5.3
 Severity:  normal          |  Resolution:
 Keywords:                  |     Focuses:
----------------------------+------------------------------
Changes (by SergeyBiryukov):

 * component:  General => Media


Old description:

> 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

New description:

 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

--

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/48712#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list