Make WordPress Core

Opened 8 years ago

Closed 8 years ago

#34460 closed enhancement (duplicate)

wp_img_add_srcset_and_sizes function: Make the fallback set the width variable

Reported by: jaspermdegroot's profile jaspermdegroot Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.4
Component: Media Keywords:
Focuses: performance Cc:

Description

Passing the width to wp_get_attachment_image_sizes() prevents a call to image_get_intermediate_size() so we can improve performance by setting the $width variable if metadata is used to get the image size.

Related #34430. See https://core.trac.wordpress.org/attachment/ticket/34430/34430.2.diff which removes the $width argument from wp_get_attachment_image_sizes() and uses $size_array (array( width, height)) instead.

Attachments (1)

34460.diff (458 bytes) - added by jaspermdegroot 8 years ago.

Download all attachments as: .zip

Change History (2)

@jaspermdegroot
8 years ago

#1 @azaozz
8 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #34430. Please see the patches there, they do this and a lot of other optimizations.

Note: See TracTickets for help on using tickets.