[wp-trac] [WordPress Trac] #29795: Set JPEG quality for individual image_size

WordPress Trac noreply at wordpress.org
Mon Sep 29 14:20:55 UTC 2014


#29795: Set JPEG quality for individual image_size
--------------------------+-----------------------------
 Reporter:  Drivingralle  |      Owner:
     Type:  enhancement   |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Media         |    Version:
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 Based on this idea I would like to work on this topic:
 https://wordpress.org/ideas/topic/jpeg-compression-factor-for-different-
 image_size

 Usecase:
 If a theme use an image as a full screen background image the image
 quality doesn't need to be as high as for a featured image or thumbnail.
 The difference in file-size would benefit the webspace and the speed on
 page load.

 I can think of two ways to solve it:

 1. Add a argument to add_image_size:
 {{{
 add_image_size( $name, $width, $height, $crop, $quality );
 }}}

 2. Add filter for it:
 {{{
 apply_filters( 'jpeg_quality_for_image_size', $quality, $size );
 }}}

 In both cases the information about the current image size needs to be
 added to the set_quality or get_quality functions to be available.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/29795>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list