Make WordPress Core

Opened 11 years ago

Closed 11 years ago

#34460 closed enhancement (duplicate)

wp_img_add_srcset_and_sizes function: Make the fallback set the width variable

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

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 11 years ago.

Download all attachments as: .zip

Change History (2)

#1 @azaozz
11 years ago

  • Milestone Awaiting Review
  • Resolution → duplicate
  • Status new → 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.