#33214 closed enhancement (fixed)
Allow media file size to be set from metadata when viewing media modal
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 4.4 | Priority: | normal |
Severity: | normal | Version: | 3.5 |
Component: | Media | Keywords: | has-patch needs-testing |
Focuses: | Cc: |
Description
When viewing an attachment in the edit post screen, the file size is either calculated from the actual file, or taken from 'filesize' if set, from wp_get_attachment_metadata()
. This alternative to using filesize( $file );
is helpful for image plugins that store the file somewhere else, i.e. it doesn't exist locally.
However, when you view the media in the modal, the file size is only calculated using the local file.
Attachments (1)
Change History (7)
#3
@
10 years ago
- Owner set to wonderboymusic
- Resolution set to fixed
- Status changed from new to closed
In 34258:
#4
@
9 years ago
This is great, but is there anywhere in core where the filesize is actually being stored in the metadata? From what I can tell, these queries are always going to turn up nothing and wind up having to actually look at the filesystem to get the file size. In which case, why add this overhead of asking the DB/metadata first?
#5
follow-up:
↓ 6
@
9 years ago
Upon further review, it looks as though WP does populate filesize, but only for media types that get processed by the ID3 library. Is that right? Seems odd to do it for some filetypes and not others.
#6
in reply to:
↑ 5
@
5 years ago
Replying to drywallbmb:
Upon further review, it looks as though WP does populate filesize, but only for media types that get processed by the ID3 library. Is that right? Seems odd to do it for some filetypes and not others.
That indeed seems to be the case. Related: comment:8:ticket:47459.
This patch unifies the implementation between
/wp-admin/includes/media.php line 2823
and
/wp-includes/media.php line 2765