Skip to content

Instantly share code, notes, and snippets.

Tim Bunch timbunch

View GitHub Profile
@timbunch
timbunch / wp-image-crop-position.php
Created Jul 14, 2017 — forked from ryanriatno/wp-image-crop-position.php
WordPress: Set an image's crop position and rotates images based on EXIF information if necessary
View wp-image-crop-position.php
<?php
/* Example Usage:
* bt_add_image_size( 'product-screenshot', 300, 300, array( 'left', 'top' ) );
* bt_add_image_size( 'product-feature', 460, 345, array( 'center', 'top' ) );
*/
add_filter( 'intermediate_image_sizes_advanced', 'bt_intermediate_image_sizes_advanced' );
add_filter( 'wp_generate_attachment_metadata', 'bt_generate_attachment_metadata', 10, 2 );
/**
You can’t perform that action at this time.