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.
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).
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.
* 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).
Version 5.4 | Requires at least: 2.5 | Tested up to: 6.4.2
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.
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>
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.
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" />
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.
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);
}?>
= 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

(16 years ago)
Thanks for your assistance Demon, but your solution failed, either on my production site or on my local test mirror (no plugin, fresh 3.03 install). The plugin worked after installation, but when I tried to modify its preferences in the admin panel, it just died. Pretty strange. I had stability issues with Guan plugin and my aim was to reload user comments into your addon…
Merry Xmas 😉
(16 years ago)
Version 2.1 release, new image notes listing in admin page which allow you to approve, edit and remove every single image note.
Merry Christmas every one!
(16 years ago)
yay… this image note is for admin only!!!
(16 years ago)
When upgrading to the latest version (unfortunately still not working with my site…) a new undesired extension appeared : WP-Digg Style Paginator by Victor de la Rocha, which put a mess on my site.
(16 years ago)
thanks for trying this new plugin, also thanks for pointing out the style issue, you can disable WP-Digg style in imageannotation-run.php.
May I know what version u trying on you site, did u try disable others plugin and test?
(16 years ago)
Thanks for your assistance, Demon. My WP is 3.03, your addon is 2.1. I just tried a new local install on a virigin WP, single (admin) user. The plugin worked… until I modified one parameter (admin only set to ‘no’). The extension just crashed ! No more frame, nor comments, gravatar… on the picture : nothing. I also noticed before that the comments don’t load under Safari, when FF shows them.
(16 years ago)
The image note open for public (admin only set to ‘no’) doesn’t effect the plugin, may I know what others settings did you set? Before that did you set the content wrapper correctly? Is the plugin auto inset ID attribute, if not did u insert the id manually?
What safari version you using? I tested on safari 5.0.2 is working fine.
(16 years ago)
Safari is the latest (5.03). Everything is ‘on’ except ‘admin only’. I’ve entered ‘.entry-content’ as the content wrapper.
Lastest news : the plugin mysteriously reactivated itself ❓ Seems to work pretty well. Under Safari, I can write notes, but they don’t show when I reload the page. Same under Chrome. Under FF, everything’s fine for the moment, except that I lost the comments made under the previous version (2.0) : they appear as comments under the image and in the image annotation admin panel (for the first time), but they don’t load over the image. Explanation : the note_img_ID is slightly different from 2.0 to 2.1. Apparently, version 2.1 adds article number before img number to build the whole im_ID, ins’t it ? I just reentered the correct number in my DB and now the previous comments load again.
I guess there’s a browser compatibility issue behind my problems, but I not a specialist.
Thanks.
(16 years ago)
there is a bug in ver 2.0 which already solve in ver 2.1, the maximum length of a table column which store image ID is 15 max, let say your image id is img-120-9876543210 and it will store it as img-120-9876543 because of length issue, that’s why some of notes don’t load over the image.
(16 years ago)
Well, my experience is quite different :
– I can’t load comments on an image labeled ‘img-5087’ in the db
– but one comment works on another with a long id ‘img-5075-dc93b0a36f’
– another comment don’t shows on the same image with the same id ‘img-5075-dc93b0a36f’
– a test comment made under 2.1 will give me an old format id : ‘img-5084’ and a new format on another image : ‘img-6495-dc93b0a36f’, both working.
A bit messy…
(16 years ago)
– when you say can’t load image labeled ‘img-5087′, does your comments had the IMG ID ‘img-5087′.
– have u try to alert image id attribute to see is the id correct to show ‘img-5075-dc93b0a36f’ ?
– the current plugin auto insert id should be ‘img-0123456789′ (fixed 10 length in last even include the post id), it will skip auto insert id if your current image already had images id attribute.
(16 years ago)
I think I found the problem u face, the text in your image note is in French language which contain symbol characters that cause php stop running, it is working when I change the text to normal characters, will look into this and let u know once the issue is fixed.
(16 years ago)
Demon, you rule. That was also one of my hypothesis, but I hadn’t tested it yet. Thank you very much for your job.
(16 years ago)
Finally, I think all of my problems have been solved by the last version, except the browser compatibility.
I’ve even managed to restore all my previous comments, made under Guan plugin, but the table has the same structure : the comments were listed on the admin panel, but couldn’t show over the pictures. I just edited each one manually (update button) via the image note panel and boom ! everything’s fine now.
So the special symbols (especially french accents) are not an issue, your plugin can easily manage them, both in comments and image name by the way.
Demon, you can check the results on my website 😉
Many thanks for your patience and pro support.
(16 years ago)
It’s me again… On my user-level test profile, I have access to the admin panel of the plugin. I can also modify and delete any user annotation, including administrator’s (!) whithout letting any trace (no user, ip, date of the modification). Is it a known bug ?
(16 years ago)
great plugin, thnx for sharing it ^^
(16 years ago)
Wouldn´t it be nice to make it a URL hyperlink?
(16 years ago)
Many thanks for the plugin. I had a similar problem to Tanguy above but I’ve been tried to sort it out for a couple of days and don’t manage to get it to work.
* I’m using WP 3.0.3
* cheking on Win7-IE8
* I activated the plugin and it worked 1st time for 2 notes I added as an admin.
* I then went to the settings and changed ‘admin only’ to ‘no’
* I then went back to my site and it seemed like the plugin had died, no hovering over images, no notes, etc…
* I’ve tried adding IDs manually, like… img id=”img-89″ , etc. But still nothing.
* I tried disabling (And enabling) jquery.min.js in imageannotation.php as explained above (as it might have been conflicting with other plugins or themes). It doesn’t matter the setting or theme, never working :S
* Putting the admin setting to yes doesn’t change anything either.
Any other clue for anything I could try? I downloaded the latest 2.02 version of the plugin but can’t think about what could be going wrong…
(16 years ago)
Did u set demon-image-annotation plugin status to enable?
Also to check your content wrapper, does it set correctly?
If you added image notes, does it appear in comment or image note wait as approval?
(16 years ago)
Using Firefox to set it up now. It was enable but #entrypoint was not loading the plugin, can you pls have a look at the screenshot attached? Which value should I enterin my case?
http://hotimg23.fotki.com/a/132_185/240_123/content-id.jpg
I put:
content wrapper : #post-
content wrapper : #entry-content
content wrapper : #entry-content clearfix
and they did not work. I then tried “content” and it did, but it’s finding some images outside the post. Do you know which value should work with my theme?
Cheers!
(16 years ago)
Everything so strange… ok, uninstall theme and plugin, reinstalled both, rechecked the content wrapper setting, and it seems now working with
.entry-content
The problem now seems that comments appear in the Image notes section as:
“No sync with wordpress comment” and even after pressing APPROVE and receiving
UPDATE `wp_imagenote` SET `note_approved` = ‘1’ where note_ID = ’27’ UPDATE wp_comments SET comment_approved = ‘1’ WHERE comment_ID = 1694 and comment_content = ‘Lo ataban como a los caballos!!’
Comment approved.
The button keeps displaying APPROVE and nothing has been sync’ed. Note that the comments appear in the post but not when hovering over the images :S
(16 years ago)
Now, some of the comments seem to have been approved, however some of them have been associated to a specific post, and the other ones (even with the same post id) don’t display anything.
Pls have a look at the screenshot here
http://hotimg23.fotki.com/a/92_5/139_34/response-to-empty.jpg
The notes appear ok as comments in the post itself, so not sure what can be going on.
I hope I’m close to have this nice plugin working now… Anyone has seen this before?
(16 years ago)
ie, the notes appear ok as comments ONLY, they don’t get loaded when hovering over the image for the ones that haven’t got a ‘response to’ value even though they’ve got a valid IMG ID :S
(16 years ago)
Try it under Firefox before in-depth checking. For me that’s still the only browser that works fine (in my language) with this (so great) plugin.
(16 years ago)
@sbiker : in order to make it work properly, and after two weeks of intensive testing as you did, the only way I found was 1. to use Firefox only 2. unsync annotations with WP comments.
(16 years ago)
@Tanguy, thanks for the tip. I play around the sync/un-sync functionality and noticed that:
* notes entered when it’s sync’ed do not appear when you un-sync’ed (and vice versa)
Everything was such a mess that I deleted ALL my previous notes and started from scratch, this time seemed to work following the rule above, notes entered when sync’ed were just displayed when the plugin was sync’ed. I stopped that testing there.
After I moved on to the cross-platform compatibility and now, being so close to a working solution, is when it became even more frustrating:
* notes entered with FF are just displayed in other FF browsers (checked in different computers), they fail to load for IE or Chrome.
* the same applies to those other browsers, ie, notes enteres in IE were not loaded in FF/chrome for example, but they were ok in another machine with IE.
Is this something you guys are facing as well?
(16 years ago)
New version 2.3 should fixed the problem, the image note stop loading because the return and new line issue.
(16 years ago)
Thanks demon, this one loads notes in IE & FF although I’ve found the following issues:
Chrome:
Issue 1 – not loading any notes.
IE, FF and Chrome:
Another couple of issues I’ve found when adding notes signed-out, ie, with a external user (you need to enter your username and password):
Issue 2 – “an error occured saving that note” message. Although note & comment is successfully added as unapproved.
Issue 3 – Approving the comment doesn’t approve the note in this case. You need to manually go and approve it as well.
———————
Question 1 – Something that doesn’t work in my blog is to achieve that when you enter a note, this adds a link to the image (and a small thumbnail if possible, like you’ve done in your blog) with every associated comment. Is there something I need to configure to achieve this? It would be so cool….
Many thanks for the support!
(16 years ago)
Further testing found out that the problem in Q1 was caused by an incompatibility with the Intense Debate plugin. Plugin removed and thumbnails now appearing in the comments area.
I’ve got the problem that I had a few days ago again now, comments are not loaded in IE. No idea why as they loaded yesterday when I first installed the new v2.3 version :S
(16 years ago)
A ccol feature would be that mouse over notes activate a kind of zoom as a selectable option.
(16 years ago)
This is just not working in chrome or ie. i am using the latest version. It only works in FireFox ? .. how do I solve this. And why does it only work in FF?
(16 years ago)
Hi Sirwan, when you say not working in chrome or ie, your image can’t load image note?
(16 years ago)
Yeah, I put my mouse over the image .. and that ‘loading’ animation keeps spinning around. No tag is shown. But only in FireFox it works.
(16 years ago)
may I know what chrome and ie version u using?
(16 years ago)
the latest versions possible. Now I have reinstalled it and it wont even show up again. But why does it work in FF
(16 years ago)
any help on why this doesnt work on chrome and ie.. and only in FF ?
(16 years ago)
tested working on ie and chrome, may I know what version of ie and chrome u using?
(16 years ago)
the latest versions…… infact all the versions.. it doesnt work. im using the latest wordpress 3.0 too. it doesnt work on chrome only firefox…
(16 years ago)
demon image annotation version 2.4 should fixed the loading problem
(16 years ago)
Great plugin, but version 2.3 from the WP repository does not work at all. The db table is not being created, then saving a note does not function. Is there a newer version of the plugin available?
Best regards,
paddelboot
(16 years ago)
Alright, I tweaked it. The problem was that the ALTER TABLE query was basicly called with every page request, which resulted in an error.
Regards,
paddelboot
(16 years ago)
Hi Demon. Is it possible to disable comments approve on ur plugin and how to do it?
thnx for the great plugin and looking forward to your answer.
(16 years ago)
Hi Kestutis,
To remove wp comment approve:
in imageannotation-run.php, remove $commentApprove == 1 if else statement in line 171.
To remove image note approve:
in imageannotation-run.php, remove $topten->note_approved == 1 if else statement in line 181.
(16 years ago)
this is awesome. I just wish I could get it to work on my site 🙁 haha
(15 years ago)
The plugin doesn’t work on your site? May I know what error has occurred?
(16 years ago)
Anyone have a fix for newer versions of wordpress? It seems to not be creating the data base.
(15 years ago)
Great plugin and great lens
(15 years ago)
I can see my annotations under Safari ! Holy day ! Thanks a lot, Demon.
(15 years ago)
..but I can’t see the ‘Image Note’ panel under Safari, and there’s still that security issue that allows any identified user to edit a note anonymously 😥
(15 years ago)
To fix the ‘Image Note’ panel under Safari, open imageannotation-admin.php and remove < !-- and //->, this should help display the image notes list.
(15 years ago)
Nice, it works. 🙂
(15 years ago)
What do you mean by identified user? FYI any admin user to the site are allow to edit the image notes.
(15 years ago)
Hello there! First of all, awesome script!
I’m having a problem though, how come whenever I save a note, a pop-up window says that an error has occurred while saving the note?
Test page is at http://www.figureawards.com/2011/04/1674/ – password: test
Thank you!
(15 years ago)
Hi Vince,
Thanks for trying the plugin, but the test page link is not working. The version 2.4.3 should fix the pop-up window, let us know if you still encounter any problem.
(15 years ago)
Very nice.