WordPress.org

Ready to get started?Download WordPress

Forums

Image Metadata Cruncher
How can I apply this to images already uploaded? (6 posts)

  1. theMikeD
    Member
    Posted 1 year ago #

    Can I trigger the metadata extraction that this plugin does for images that have already been uploaded?

    Regenerate Thumbnails isn't doing it for example, because my custom image metadata tag is not in the DB anywhere other than it's definition.

    http://wordpress.org/extend/plugins/image-metadata-cruncher/

  2. peterhudec
    Member
    Plugin Author

    Posted 1 year ago #

    Currently not but,

    The plugin extracts the metadata during the wp_handle_upload_prefilter hook and inserts them to DB in add_attachment hook. Theoretically it could do the extraction in any other hook or even function.

    I will look on the possibilities and let you know.

    p.s. Sorry for the delayed response. WP used to send me e-mail alerts on new threads.

  3. peterhudec
    Member
    Plugin Author

    Posted 1 year ago #

    There is a new version 1.7 of the plugin.

    There are now some new useful plugin methods which you can use in your theme:

    This one is for you:

    $image_metadata_cruncher->crunch( $attachment_ID )

    To batch update more attachments loop through their IDs and call this method for each one of them.

    More info here: http://wordpress.org/extend/plugins/image-metadata-cruncher/faq/

    Let me know if it was of any use for you.

  4. theMikeD
    Member
    Posted 1 year ago #

    Thanks Peter! I'll give this a look as soon as I can. Much appreciated :)

  5. Seppelicous
    Member
    Posted 1 year ago #

    Hi Peter,
    I have no idea how to add

    $image_metadata_cruncher->crunch( $attachment_ID )

    to my template to apply the metadata to already uploaded images.

    I wish there is an option in the plugin to apply the metadata to all images by one click :)

  6. peterhudec
    Member
    Plugin Author

    Posted 1 year ago #

    Unfortunately, there is no such a one-click option yet in the plugin.

    The $image_metadata_cruncher->crunch( $attachment_ID ) added in version 1.7 is just a public interface to internal functionality that was already there and implementing it was a matter of minutes.

    A good GUI solution would require some selection tool and a background task, which is not so trivial.
    But maybe I'll add it in future.

    A suggestion for you:

    Make a temporary one-time-use page with dedicated template.
    Inside the template iterate over all your attachment IDs and call $image_metadata_cruncher->crunch( $attachment_ID ) for each of them.

    If you have thousands of attachments you will have to iterate over smaller chunks (that's where it gets complicated).

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.