[wp-trac] [WordPress Trac] #47459: Introduce new a function to retrieve size of files

WordPress Trac noreply at wordpress.org
Wed Nov 6 13:40:41 UTC 2019


#47459: Introduce new a function to retrieve size of files
-----------------------------+-----------------------
 Reporter:  justinahinon     |       Owner:  (none)
     Type:  feature request  |      Status:  reopened
 Priority:  normal           |   Milestone:
Component:  Media            |     Version:
 Severity:  normal           |  Resolution:
 Keywords:                   |     Focuses:
-----------------------------+-----------------------
Changes (by Cybr):

 * status:  closed => reopened
 * resolution:  wontfix =>


Comment:

 I want to contribute my thoughts on this subject.

 For performance reasons, I think it's best not to touch the files more
 than necessary. Instead, we should rely on the stored image metadata, and
 let WordPress deal with filling it.

 Moreover, image processors (Smugh, WP Offload, EWWW, etc.) can do their
 thing via filters, without other developers having to guess where the
 processed image is.

 With all that, adding the file size to the metadata would be most welcome.

 I found that WordPress internally already tries to read this index (even
 though it doesn't exist):
 https://core.trac.wordpress.org/browser/tags/5.2/src/wp-
 includes/media.php#L3271

 After this is implemented, a `needs-dev-note` would be helpful, so the
 aforementioned plugins can start recognizing and (p)refilling the
 metadata.

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


More information about the wp-trac mailing list