Title: need code to improve jpeg quality
Last modified: August 24, 2016

---

# need code to improve jpeg quality

 *  [kentannenbaum](https://wordpress.org/support/users/kentannenbaum/)
 * (@kentannenbaum)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/need-code-to-improve-jpeg-quality/)
 * What’s going on is a softness to SOME of my photos, all sized properly before
   upload at 600px x 72dpi. What’s been recommended in the forum are a couple of
   code solutions that remove the size attributes before upload which some coders
   think might solve the problem of softness. If anyone has success with this I’d
   love to hear it. Here are two suggestions I came across:
    FIRST SOLUTION: dd_filter(‘
   post_thumbnail_html’, ‘remove_width_attribute’, 10 ); add_filter( ‘image_send_to_editor’,‘
   remove_width_attribute’, 10 ); function remove_width_attribute( $html ) { $html
   = preg_replace( ‘/(width|height)=”\d*”\s/’, “”, $html ); return $html; } SECOND
   SOLUTION: function gpp_jpeg_quality_callback($arg) { return (int)100; } add_filter(‘
   jpeg_quality’, ‘gpp_jpeg_quality_callback’); HERE’S MY SITE: [http://kentannenbaum.com](http://kentannenbaum.com)

Viewing 5 replies - 1 through 5 (of 5 total)

 *  [Mike](https://wordpress.org/support/users/mike_vl/)
 * (@mike_vl)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/need-code-to-improve-jpeg-quality/#post-6162650)
 * Have you tried and tested both solutions?
 *  Thread Starter [kentannenbaum](https://wordpress.org/support/users/kentannenbaum/)
 * (@kentannenbaum)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/need-code-to-improve-jpeg-quality/#post-6162711)
 * Hey Mike, no time because of the holiday…can’t get to my computer yet but will
   get it done ASAP. Believe me, I want to know. Thanks.
 *  Thread Starter [kentannenbaum](https://wordpress.org/support/users/kentannenbaum/)
 * (@kentannenbaum)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/need-code-to-improve-jpeg-quality/#post-6162788)
 * One of the issues, if not THE issue is that I’ve been running this iMac at a 
   different resolution than the default, which is 1920×1080. I like a slightly 
   larger feel for my retouching work so it’s been at 1600×900 for a long time and
   it’s made some of the images seem soft in looking at the site. FYI, I did upload
   the leading image on my homepage using both sets of code loaded into the child
   theme css and it made no difference. As mentioned, the goal was to eliminate 
   the size attributes and see what would happen to sharpness. Even if one of the
   two solutions worked I wouldn’t know because of my apparent bone-head move of
   using a resolution that brings the images up above 100% probably causing the 
   softness. Sorry for the inconvenience of looking into a problem that’s of my 
   own doing.
 *  [David_G](https://wordpress.org/support/users/questas_admin/)
 * (@questas_admin)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/need-code-to-improve-jpeg-quality/#post-6162792)
 * Your images are showing crystal clear on my PC. Just thought you might like to
   know, based on your last post. Realy nice pix by the way.
 *  Thread Starter [kentannenbaum](https://wordpress.org/support/users/kentannenbaum/)
 * (@kentannenbaum)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/need-code-to-improve-jpeg-quality/#post-6162794)
 * That is seriously gratifying on both counts…thanks very much.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘need code to improve jpeg quality’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 5 replies
 * 3 participants
 * Last reply from: [kentannenbaum](https://wordpress.org/support/users/kentannenbaum/)
 * Last activity: [10 years, 11 months ago](https://wordpress.org/support/topic/need-code-to-improve-jpeg-quality/#post-6162794)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
