[wp-trac] [WordPress Trac] #47872: Try to create image sub-sizes again when uploading fails with a PHP fatal error

WordPress Trac noreply at wordpress.org
Thu Oct 24 08:44:28 UTC 2019


#47872: Try to create image sub-sizes again when uploading fails with a PHP fatal
error
-------------------------------------------------+-------------------------
 Reporter:  azaozz                               |       Owner:  azaozz
     Type:  enhancement                          |      Status:  closed
 Priority:  high                                 |   Milestone:  5.3
Component:  Upload                               |     Version:
 Severity:  normal                               |  Resolution:  fixed
 Keywords:  has-patch needs-testing has-         |     Focuses:
  screenshots close has-dev-note                 |
-------------------------------------------------+-------------------------

Comment (by mikeschroder):

 Replying to [comment:32 GregLone]:
 > Indeed, I don't see any way to pass a context to this hook.
 > By the way, I'm mixing #40439 and this ticket here, tell me if I'm not
 at the right place to discuss this.

 They're definitely related! This ticket is fine.
 <snip>

 > Since I use `updated_post_meta/added_post_meta` to trigger what I want
 to do (automatic optimization of the images) (so I'm sure the post meta
 value is up-to-date in the DB), it became more difficult to
 [https://github.com/wp-media/imagify-plugin/blob/improvement/compat-wp53
 -save-progress-upload/inc/classes/class-imagify-auto-
 optimization.php#L66-L67 trigger only when all is done], and not for each
 size.
 >
 > I see that both `wp_create_image_subsizes()` and
 `wp_update_image_subsizes()` use `_wp_make_subsizes()`, why not adding
 this hook at the end of it?

 Yes! The idea is to start performing operations and saving meta per size,
 rather than per attachment so that users can use the images that have been
 created so far right away, and so that if an upload fails, it can be
 resumed.

 Could you please walk me through why in this case it's best to run after
 all current sizes are done, rather than doing so per size? Want to be sure
 I understand the use-case.

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


More information about the wp-trac mailing list