Skip to content

Instantly share code, notes, and snippets.

@thefrosty
Created September 18, 2010 19:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thefrosty/585954 to your computer and use it in GitHub Desktop.
Save thefrosty/585954 to your computer and use it in GitHub Desktop.
function add_orientation_exif( $meta, $file, $sourceImageType ) {
$exif = @exif_read_data( $file, 'IFD0' );
if ( !empty( $exif['IFD0']['Orientation'] ) )
$meta['IFD0']['orientation'] = $exif['IFD0']['Orientation'];
return $meta;
}
add_filter( 'wp_read_image_metadata', 'add_orientation_exif', '', 3 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment