[wp-trac] [WordPress Trac] #20840: Allow JPEG quality setting for images resized with Plupload

WordPress Trac wp-trac at lists.automattic.com
Mon Jun 4 22:18:16 UTC 2012


#20840: Allow JPEG quality setting for images resized with Plupload
-------------------------+--------------------------------------
 Reporter:  dominicp     |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  Upload       |    Version:  3.4
 Severity:  normal       |   Keywords:  2nd-opinion dev-feedback
-------------------------+--------------------------------------
 As far as I can tell, the quality setting for JPEGs resized with Plupload
 is hard-coded at `100` here: http://core.trac.wordpress.org/browser/trunk
 /wp-includes/js/plupload/handlers.dev.js#L104

 The simplest solution I can see is to add another javascript variable for
 Plupload in the media.php file
 (http://core.trac.wordpress.org/browser/trunk/wp-
 admin/includes/media.php#L1374) leveraging the already present
 `jpeg_quality` filter. Then, the line in "handler.dev.js" could just
 reference that variable.

 '''Changing this:'''[[BR]]
 `var resize_height = <?php echo $large_size_h; ?>, resize_width = <?php
 echo $large_size_w; ?>,`

 '''To this:'''[[BR]]
 `var resize_height = <?php echo $large_size_h; ?>, resize_width = <?php
 echo $large_size_w; ?>, resize_quality = <?php echo apply_filters(
 'jpeg_quality', 100 ); ?>,`

 From a higher-level perspective, I have to say that I struggle a bit with
 the work-flow for image processing in WordPress. Like many others, I want
 to compress my images to speed up page loads as much as possible. The
 problem is that if I upload an already compressed JPEG (e.g. Quality 70),
 when WordPress resizes and compresses it I wind up with double
 compression. So, I plan to upload only upload full quality JPEGs, but when
 someone wants to see the full sized (original) version of the image, they
 get a bigger file than is necessary because I had to upload it at full
 quality.

 I'm sorry if that doesn't make much sense, but there doesn't seem to be an
 easy way to have all JPEGs (even the full sized version) be compressed
 without double-compressing the smaller versions. From what I can gather,
 this used to be possible via the `wp_upload_resize` filter. But, in
 #19800, that was removed in favor of letting Plupload resize images.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/20840>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list