Make WordPress Core

Opened 4 months ago

Last modified 4 months ago

#59684 new defect (bug)

'filesize' metadata not updated after resizing media

Reported by: vertisoft's profile vertisoft Owned by:
Milestone: Awaiting Review Priority: normal
Severity: minor Version: 6.3.3
Component: Media Keywords: has-testing-info needs-patch
Focuses: Cc:


It seems like WordPress does not update the 'filesize' metadata after an image is modified through the media library. The details panel in the media library displays the original file size instead of the 'new' file size.


  • WordPress: 6.3.3-alpha-56924
  • PHP: 8.2.10
  • Server: Apache
  • Database: mysqli (Server: 5.7.31 / Client: mysqlnd 8.2.10)
  • Browser: Chrome (Windows 10/11)
  • MU-Plugins: None activated
  • Plugins:
    • WordPress Beta Tester 3.5.4

The following optional modules are not currently installed on our server:

  • exif
  • fileinfo
  • imagick

Steps to Reproduce

  1. Upload a new image in the media library
  2. Note the file size (ie. 22 KB)
  3. Resize the image by clicking on 'Edit Image', then 'Scale Image' (in my test case, I resized the image from 1920x1080 to 200x113)
  4. Click 'Update'
  5. The 'Dimensions' field is correctly updated, but 'File size' remains the same (22 KB)

Expected Results

The 'File size' should display the new file size (ie. 3.3 KB)

Actual Results

The 'File size' field displays the size of the original image, before it was resized.

Here is the value of the '_wp_attachment_metadata' field in the database after the media is resized:


The "filesize" metadata has the value '22990' instead of '3033'.

Attachments (3)

Test.png (22.5 KB) - added by vertisoft 4 months ago.
Test image
Before.jpg (138.0 KB) - added by vertisoft 4 months ago.
Before resizing
After.jpg (165.7 KB) - added by vertisoft 4 months ago.
After resizing

Download all attachments as: .zip

Change History (5)

4 months ago

Test image

4 months ago

Before resizing

4 months ago

After resizing

This ticket was mentioned in Slack in #core-test by ankit-k-gupta. View the logs.

4 months ago

#2 @Ankit K Gupta
4 months ago

  • Keywords has-testing-info needs-patch added
Note: See TracTickets for help on using tickets.