Image Annotation Plugin

Have you ever wanted to annotate your images like you can on Flickr and Facebook? It was fun but when I look for wordpress plugin to integrate similar functionality to the superwhite site and none was available. So I found JQuery Image Annotation from Chris with PHP support from GitHub. In a week, I had written my first plugin for WordPress called demon-image-annotation, the concept of annotating images with user comments. In recent posts you might notice there is a new button name “Add Note” on each images when you rollover, that would allows you to add textual annotations to images by select a region of the image and then attach a textual description. Here try it for yourself.

demon Image Annotation plugin for WordPress

This plugin allows you to add textual annotations to images by select a region of the image and then attach a textual description, the concept of annotating images with user comments.

Integration with JQuery Image Annotation from Chris (http://www.flipbit.co.uk/jquery-image-annotation.html) with PHP support from GitHub (http://github.com/stas/jquery-image-annotate-php-fork).

Need Your Support

It is hard to continue development and support for this free plugin without contributions from users like you. If you enjoy using demon Image Annotation and find it useful, please consider making a donation. Your donation will help encourage and support the plugin’s continued development and better user support.


Some features:

* Admin page
* Option to approve, edit amd remove image notes in admin page.
* Auto insert unique id attribute for all the images for image note.
* Show notes on other pages such as home and archive.
* Gravatar in the notes
* Option to sync with wordpress comments.
* Option to show thumbnail in comment list.
* Option to include post id in every auto insert images id.
* ‘Mouseover to load notes’ on top of every image note (editable).
* ‘Link’ on top of every image note if hyperlink image (editable).

Download Plugin

Version 5.4 | Requires at least: 2.5 | Tested up to: 6.4.2

Installation

1. Put the plugin folder into [wordpress_dir]/wp-content/plugins/
2. Go into the WordPress admin interface and activate the plugin
3. Choose the settings you want in demon-image-annotation settings.

How To Use

Step 1:

First enter div wrapper id or class in settings where your post content appear, or else the plugin can’t find the wrapper to start.

Example (.entrybody)

<div class="entrybody>
<?php the_content(); ?>
</div>

Step 2:

To embed annotations and comments on images, your img tag must have id attribute value start with ‘img-‘, this plugin already did the trick if you enable Auto Generate Image ID option.

Step 3:

If you wish to add an id attribute maunally, here is the guide on how to insert id attribute to img tag.

– First disable Auto Generate Image ID option
– Add an id attribute start with ‘img-‘ follow by unique id to img tag.
– All the images must have unique and different id or else you will get the same comments.

Example (img-4774005463)

<img id="img-4774005463" src="http://farm5.static.flickr.com/4121/4774005463_3837b6de44_o.jpg" width="900" height="599" alt="Image Annotation Plugin" />

Step 4:

Decide the option for WordPress Comments setting.

Sync with wordpress comments:
– image note sync with wordpress comment database
– modified comment will auto update both database
– deleted comment from wordpress comment will not sync, have to delete manually in image notes table list.
– new image note from annoymous will auto add into wordpress comment as waiting approval.
– the image note only publish when the comment is approve.

Not sync with wordpress comments:
– standalone image note database.
– new image note will publish without approval.

Pls note if you switch the option, the comments added with previous option will not load.

Usage

Disable Add Note button:
Add an addable attribute with value “false” to disable the add note button, but image notes still viewable.
Login User who can Moderate Comments still able to see Add button option.

<img id="img-4774005463" addable="false" src="http://farm5.static.flickr.com/4121/4774005463_3837b6de44_o.jpg" width="900" height="599" alt="Image Annotation Plugin" />

Exclude image:
Add an exclude attribute to disable image annotation function.

<img exclude id="img-4774005463" src="http://farm5.static.flickr.com/4121/4774005463_3837b6de44_o.jpg" width="900" height="599" alt="Image Annotation Plugin" />

Comments thumbnail:
To add thumbnails to your comments list manually, just add the php code below in your comment callback function.

<?php if (function_exists('dia_thumbnail')) {
dia_thumbnail($comment->comment_ID);
}?>

Live Demo:

Image Annotation Plugin

Tsukasa Hiiragi
Where Tsukasa carry the iPhone to?
Admin Screenshots:

Image Annotation Plugin
demon image annotation settings screencap
Image Annotation Plugin
demon image annotation table listing screencap
Image Annotation Plugin
demon image annotation editing screencap
Change log

= 5.4 =
* Improve security

= 5.3 =
* Fixed plugin issue

= 5.2 =
* Improve security

= 5.1 =
* Improve security

= 5.0 =
* Improve security
* Improve wordpress coding standard

= 4.8 =
* Improve security

= 4.7 =
* Fixed Data Validation
* Added localization file

= 4.6 =
* Securing input & output
* Added spam notes

= 4.5 =
* Replace mysql_real_escape_string() with esc_sql()
* Improve admin options UI
* Organized plugins files in folder
* Organized plugins files name
* Organized plugins script and style files

= 4.1 =
* Fixed resize issue

= 4.0 =
* Auto resize option now enable responsive mode

= 3.9 =
* Fixed multiple form issue

= 3.8 =
* Replace mysql_real_escape_string() with esc_sql()

= 3.7 =
* Added admin plugin tab
* Updated CSS buttons
* Fixed auto update WordPress Comments database issue
* Fixed dashboard menu count issue

= 3.6 =
* Fixed image description

= 3.5 =
* Fixed image numbering issue

= 3.4 =
* Fixed post ID issue

= 3.3 =
* Fixed auto update WordPress Comments database issue
* Fixed notes overlap issue
* Fixed notes not resize according to image size
* Added image notes count number to admin bar and menu

= 3.2 =
* Modifiend database column
* Fixed backslash in image note
* Remove auto generate ID and post ID in jQuery
* Replace auto generate ID and post ID with filter function
* Option to disable numbering
* Option to auto resize image annotation to fit content max width
* Image annotation able to show on home page

= 3.1 =
* Fixed Annotation jQuery.

= 3.0 =
* Fixed HTTPS issue
* Fixed wordpress comment synced with image note data.
* Update database column.
* Update admin image notes table list.
* Update jQuery version to 2.1.1
* Update jQuery UI version to 1.11.2
* Add Image preview in admin image notes table list.
* Add edit image button in wordpress comment table list.
* Add submenu to admin page
* Add comments maxlength setting
* Able to manage settings base on roles and capabilities
* Able to approve, edit and remove image notes base on roles and capabilities
* Able to add new line for image notes
* Able to restore comment from Trash in admin image notes table list.

= 2.5.4 =
* Thumbnail resize fixed.
* Thumbnail preloader.

= 2.5.2 =
* Fixed addable for admin only.

= 2.5 =
* Fixed image annotation script.
* Fixed php JSON data.
* Fixed not workin in ie.
* New admin table list.

= 2.4.8 =
* Fixed MD5 not working.

= 2.4.7 =
* Fixed bugs.

= 2.4.6 =
* Fixed jquery conflict.

= 2.4.5 =
* Fixed missing add button.

= 2.4.4 =
* Added approve and unapprove button for selected image notes.
* Fixed table prefix issue

= 2.4.3 =
* Fixed on table name issue.
* Fixed pop up error while saving.
* Fixed image notes not loading (when comment or image note is not approve yet).
* Show error occured message when loading image notes timeout.
* Add option to remove HTML image tags.

= 2.4.1 =
* Fixed on Image Notes Tab not display in Safari browser.

= 2.4 =
* Fixed on Chrome and IE browsers.

= 2.3 =
* Fixed return and new line issue that cause image note stop loading.

= 2.2 =
* New image note as waiting approval even it is not sync with wordpress comment.
* Fixed image note not loading with special characters.
* Image note settings now is display for admin only.
* Customize default avatar for image note author gravatar.

= 2.1 =
* Rounded border.
* Add list of image notes in admin page.
* Add option to approve, edit and delete image notes.
* Add option to change mouseover description and image hyperlink name.
* Add option to lnclude post id in every auto insert images id.
* Fix issue of database prefix is not wp_.
* move author to top.

= 2.0 =
* Admin page
* Auto insert id attribute start with “img-“.
* Add notes to your uploaded pictures and embed pictures.
* Add author gravatar on notes.
* Add option to show image notes not only in single page but other pages such as home and archives.
* Add option which enable user to disable or enable noted image for admin only or every user.
* Add option which enable user to disable or enable WordPress commenting system.
* Add option which enable user to disable or enable noted image thumbnail at comment list.
* Add description on top of every image note ‘Mouseover to load notes’.
* Add link on top of every image note if hyperlink image.

= 1.2 =
* Delete comments
* Comment thumbnail hover

= 1.1 =
* Fix note overlap
* Image note user addable

You may also like
46
101
131
158
187
215
219 white comments    
  • demon said,
    May 16, 2011 | 11:46 pm
    (15 years ago)
     

    Version 2.4.3 release:
    * Fixed on table name issue.
    * Fixed pop up error while saving.
    * Fixed image notes not loading (when comment or image note is not approve yet).
    * Show error occured message when loading image notes timeout.
    * Add option to remove HTML image tags.

  • Tanguy said,
    May 31, 2011 | 5:08 am
    (15 years ago)
     

    On my WP, for some reason last version doesn’t work under Safari. Still fine under FF. No problem on your site under Safari, I know… 😥

    • demon said,
      May 31, 2011 | 11:40 am
      (15 years ago)
       

      Did you try demon image annotation the latest version?

      • Tanguy said,
        May 31, 2011 | 5:37 pm
        (15 years ago)
         

        Yeah, it’s the latest update, but tomorrow morning everything ‘s OK under Safari, maybe a problem of cache yesterday (?).

  • Tanguy said,
    May 31, 2011 | 5:13 am
    (15 years ago)
     

    By the way, I’d like to be able to approve batches of comments instead of doing this one by one. And there still a security issue : my logged in users can edit any any annotation without letting any trace on the site.

    • demon said,
      May 31, 2011 | 11:50 am
      (15 years ago)
       

      Any logged in user are allow to edit the image annotation, what you can do is change the setting to identify by email, here’s how:

      1) open up imageannotation.php
      2) after line 74 add the code below



      addablepage = false;
      addablecon = false;
      editable = false;

      3) replace ‘your@email.com’ to your administrator email

  • Tanguy said,
    May 31, 2011 | 5:43 pm
    (15 years ago)
     

    In fact I’ve changed line 66 editable ‘true’ -> ‘false’, and my security issue is fixed. I’d just wish in a future that only authors can edit their own annotations, and maybe that they have access to the list in a kind of admin panel.
    Thanks for your support Demon, you rule 😉

  • Mushon said,
    June 5, 2011 | 10:03 pm
    (15 years ago)
     

    I just installed version 2.4.3 on WordPress 2.1.3
    I am getting a console error:
    $ is not a function
    [Break On This Error] $(” img”).each(function() {

    This might be due to the fact jQuery is running in no-conflict mode and therefore cannot identify the $ sign as a function. This is probably not only happening to me. I would recommend running the plugin in no-conflict mode too.

    Thanks for your work, I would really love to get to use it. ❓

  • ovidiu said,
    June 17, 2011 | 9:24 pm
    (15 years ago)
     

    same problem here. this also has the effect that every javascript on the whole site is broken 🙁
    don’t know much about jquery but no-conflict sounds good 🙂

  • demon said,
    June 20, 2011 | 12:12 pm
    (15 years ago)
     

    To mushon and ovidiu,
    The plugin might conflict with other plugins or themes jquery, try open imageannotation.php and disable code line 14.

  • wholmes said,
    June 30, 2011 | 12:10 am
    (15 years ago)
     

    Thanks for all your effort on this and for sharing it!

    On my install (WP 3.1.3 and Demon 2.4.3 + Chrome) It’s not saving the notes. also my table is not “wp_imagenote” it’s installing as “demon_imagenote” …of course the wp_ is definitely what I’d prefer. But besides that it just not saving the notes and the Drag feature isn’t working although the resize feature is. Any assistance is appreciated.

    Thanks again!

    • wholmes said,
      June 30, 2011 | 12:30 am
      (15 years ago)
       

      I see that there’s an explicit reason the table is named demon_ Once I get this working will it be possible to use the wp_ prefix.?

  • James said,
    June 30, 2011 | 12:57 am
    (15 years ago)
     

    I have the same problem as wholmes. It seems to be failing to load the notes from the database when I mouseover the picture. Running WP3.1.3, 2.4.3 & Chrome also.

    Fantastic plugin though! Very much appreciated.

  • demon said,
    June 30, 2011 | 11:13 am
    (15 years ago)
     

    Hi wholmes and james,

    If the plugin falling to load notes means the result that return from php cause the jquery stop running. That indicates that you’re running a really new version of PHP 5, which adds those warnings on older PHP 4 compatible code. Try add this to the top of your wp-config.php file, right after the first < ? php line: error_reporting(0); Try and let me know, thanks.

  • James said,
    June 30, 2011 | 4:34 pm
    (15 years ago)
     

    Hey Demon,

    Yep works perfectly now! 😀 Thanks for the help!

  • wholmes said,
    June 30, 2011 | 11:05 pm
    (15 years ago)
     

    Thanks Demon,

    Sadly, that did not work for me. The entry form is loading allowing me to comment but when I return to the page the only comments that are saved are with the wp_comment system. The demon comments are not saving.

    More… when I first save the comment it creates the thumbnail image and places it at the wp_comments area. But a page refresh it disappears and the wp_comment is all that remains.

    • Tanguy said,
      July 1, 2011 | 2:59 am
      (15 years ago)
       

      @ Wholmes and James,
      Have you approved comments in the demon admin page before reloading the image ? On my install (unsync with WP comments), the comments don’t show if I don’t approve them. Any new unapproved comment on an image will make crash mouseover. Hope it helps.

  • wholmes said,
    June 30, 2011 | 11:26 pm
    (15 years ago)
     

    One more thing… I’m using this on a multisite install. I haven’t network installed it it’s just running on one site within the network. Not sure if this has effect or not.

    It might be worth noting that Guam Image annotation version does work on my system as it’s supposed to bu I wanted the added features and admin panel.

    Thanks again!

  • wholmes said,
    July 1, 2011 | 6:10 am
    (15 years ago)
     

    All the comments are registering as approved but the demon table is definitely empty.

  • zane said,
    July 2, 2011 | 1:09 am
    (15 years ago)
     

    Sorry for the double comment…

    wholmes,

    I’m having the same problem as you and after a quick look at my db, the prefix appears to be the exact problem. Since WP + Networking prefix’s your table fi your custom prefix + _ + blogid, end result: wp_2_demon_imagenote.

    It should be a quick fix of checking for multisite install if so use the prefix + _ + blogid when creating the table. I’ll dive into the plugin core later this evening, but I have ZERO desire to HACK the core of this plugin to get it working, rather will contribute the fix and have Demon approve it, update the plugin with my patch and update the plugin repo.

  • wholmes said,
    July 4, 2011 | 9:54 pm
    (15 years ago)
     

    Thanks Zane… I was thinking the same thing… Please post if you have a fix, I really appreciate it… could you post the hack just in case Demon doesn’t have time or desire to do the update? Thanks again.

    Happy 4th!!

  • wholmes said,
    July 4, 2011 | 10:03 pm
    (15 years ago)
     

    Just an added thought… nothing to do with my earlier post above.

    One thing I’d like to see in this plugin… The thumbnails that are created contain only the part of the image that was selected in the imagenote.

    Example usage: Take a classroom photo and make an imagenote of a classmate… selecting that classmates face in the photo. Then when you look at the comments that persons face is the thumbnail… Seems like a cool and logical next step for the script I think… Anyways Thanks again Demon!

Your thought

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.