Skip to content

WordPress plug-in. Adds the ability to programmatically specify the JPG quality of individual custom image sizes in WordPress. Perfect for keeping the filesize of retina images down, among other things.

License

Notifications You must be signed in to change notification settings

StickyBeat/custom-image-size-quality

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

WP plug-in for custom image size quality

Adds the ability to programmatically specify the JPG quality of individual custom image sizes in WordPress.

Perfect for keeping the filesize of retina images down, among other things.

Usage

Typically, you would use this code for defining custom image sizes:

add_image_size( 'custom-size', 500, 300, true );

This plug-in lets you do this:

set_image_size_quality( 'custom-size', 40 );

Installation

Just copy the whole "custom-image-size-quality" folder into your "wp-content/plugins" folder. Then activate the plug-in in wp-admin as usual.

Credits

I found the hook approach at this informative URL:

http://wordpress.stackexchange.com/questions/74103/set-jpeg-compression-for-specific-custom-image-sizes

I then prettied it up and formed a plugin out of it. Modified the scaling to use WP's own Image Editor functionality, which will then use GD or ImageMagick (or other custom editor) based on availability and preferences.

Version 1.1

  • Fixed a critical bug that caused multiple sizes to crop based on the previous size dimensions.
  • Changed hook approach to use a filter hook ("update_post_metadata"), which will trigger not only on uploads, but also on updates, making this plugin more compatible with plugins like "Regenerate Thumbnails".

Comments and suggestions

Why don't you just send those to [email protected]?

About

WordPress plug-in. Adds the ability to programmatically specify the JPG quality of individual custom image sizes in WordPress. Perfect for keeping the filesize of retina images down, among other things.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages