WordPress.org

Ready to get started?Download WordPress

Forums

Post Thumbnail Editor
[resolved] Hook for image filters (5 posts)

  1. jopl
    Member
    Posted 2 years ago #

    Hi again!

    I modify the uploads to make som thumbnails in grayscale with this function: http://ottopress.com/2011/customizing-wordpress-images/

    The files generated by Post Thumbnail Editor isn't filtered. The above function hooks into the metadata saving step of the upload and I guess PTE does not change the meta. Is it possible to manipulate the PTE generated thumb?

    http://wordpress.org/extend/plugins/post-thumbnail-editor/

  2. sewpafly
    Member
    Plugin Author

    Posted 2 years ago #

    I will look into calling this same hook. It shouldn't be too difficult to add that functionality.

    Update: To add this functionality modify post-thumbnail-editor/php/functions.php around line 639

    Change

    $logger->debug( "Updating '{$size}' metadata: " . print_r( $metadata['sizes'][$size], true ) );
    		wp_update_attachment_metadata( $id, $metadata);

    to

    $logger->debug( "Updating '{$size}' metadata: " . print_r( $metadata['sizes'][$size], true ) );
          wp_update_attachment_metadata( $id,
             apply_filters( 'wp_generate_attachment_metadata', $metadata, $id ));
  3. sewpafly
    Member
    Plugin Author

    Posted 2 years ago #

    Alternately you might be able to just hook into the wp_update_attachment_metadata filter as that is already being fired.

  4. Corinne
    Member
    Posted 2 years ago #

    Hi, I've got a similar request.

    I use a plugin called Sharpen Resized Images, which hooks into the 'image_make_intermediate_size' step. I was just wondering if you knew of a way I could add this function to your plugin file to sharpen the resulting thumbnails after I crop them.

    Thanks.

    http://wordpress.org/extend/plugins/sharpen-resized-images/

  5. sewpafly
    Member
    Plugin Author

    Posted 2 years ago #

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic