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

WordPress Trac noreply at wordpress.org
Wed May 29 23:59:34 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 azaozz):

 Been looking at the patches for the last few days. It's getting big and
 need to add few more functions, at least. Starting to think it may help if
 we split this in several tasks/tickets perhaps?

 As far as I see the main tasks are:
 1. Update `WP_Image_Editor_GD` and `WP_Image_Editor_Imagick` (and
 `WP_Image_Editor` if needed) to handle saving of a single sub-size (this
 is already in the patch, may need review/refresh).
 2. Review `_wp_create_image_subsizes()` and related new functions.
 3. Retire `multi_resize()` (stop using it in core), and keep it for back-
 compat. Wondering if it should call the external (to the class)
 `_wp_create_image_subsizes()` or still attempt to do all sub-sizes at
 once. Seems better to use the new functionality, but may run into some
 problems perhaps (will be over multiple requests so not all image sub-
 sizes will be available after it runs, etc.).
 4. Add function(s) to resize images over multiple requests. Wondering if
 we should try something like the
 [https://core.trac.wordpress.org/browser/tags/5.2.1/src/wp-
 includes/cron.php#L667 "alternate cron redirecting"] here, not sure if it
 works well. Perhaps just do a chain of `wp_remote_post()` until there are
 no more sub-sizes to be created.
 5. Revisit the UI to create missing sub-sizes. TBD: do we want it or need
 it in core or shall we leave it for plugins? If yes, it needs adding to
 the media modal, and perhaps other places images can be uploaded (custom
 header, etc.).

 The 4) is not in the patch yet and seems it will need most testing. It
 should handle multiple images, so we are looking at temporarily storing a
 queue of image sub-sizes that need to be created, and chaining multiple
 requests until that queue is emptied. Of course this will need safeguards
 against circular dependencies, retry on fail, etc.

 Thinking we can split (at least) 4) and 5) into separate tickets. Seems
 1), 2) and 3) can be handled here and committed soon, so we can continue
 with the rest.

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


More information about the wp-trac mailing list