[wp-trac] [WordPress Trac] #40439: Save progress of intermediate image creation after upload

WordPress Trac noreply at wordpress.org
Fri May 24 08:57:47 UTC 2019


#40439: Save progress of intermediate image creation after upload
-------------------------------------------------+-------------------------
 Reporter:  mikeschroder                         |       Owner:
                                                 |  mikeschroder
     Type:  enhancement                          |      Status:  assigned
 Priority:  high                                 |   Milestone:  5.3
Component:  Media                                |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch needs-testing needs-unit-  |     Focuses:  ui
  tests early                                    |
-------------------------------------------------+-------------------------

Comment (by mikeschroder):

 I noticed that when I forced image creation to crash with a low timeout,
 it didn't save the sizes generated in meta so far, and the image would
 also end up without a width and height (which causes the detection of
 sizes to create to fail -- this probably needs a check of its own as
 well). This is because `multi_resize()` was being called before
 `_wp_create_image_subsizes()`, so the crash would happen in code that does
 not save meta during resizing.

 In this patch, I moved up `_wp_create_image_subsizes()` in `image.php`,
 replacing `multi_resize()` for images, while also getting the default
 image metadata earlier so that the saved meta is more useful when it is
 saved successfully.

 This will have to be done for the other instances of calls to
 `multi_resize()` as well, but since I have to break, I wanted to document
 the partial creation working as expected in [attachment:"40439.3.diff"].

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


More information about the wp-trac mailing list