Module: Photo annotation v4.5 (v5 beta 3)

hukoeth

Joined: 2009-03-20
Posts: 127
Posted: Sat, 2010-08-28 16:01

Version 5 beta 3


If you want to test the next version of the module you can find it attached to this post along with the latest stable version.
This version uses ajax to save, delete and edit annotations eliminating the need to reload the whole page when saving, updating or deleting annotations.
Please note that I have still not figured out how to disable the "show full size" link of the image when clicking on annotations or on the delete/modify areas. Therefore the beta version removes the link completely and places a little box at the upper left corner of the re-sized image allowing to view the photo in full size.




About this module


This module allows you to create comments on photos similar to Flickr and Facebook (see screenshots below). It can notify users when a photo is tagged and comments are added.
This module is partially compatible with rWatcher's TagFaces module which means that faces/notes/annotations created with one module will be shown by the other as well (user annotations create with the Photo annotation module will however not be shown by the TagFaces module).

IMPORTANT: You cannot run both modules at the same time.

Codex page: http://codex.gallery2.org/Gallery3:Modules:photo_annotation




Screenshots


Add and edit annotations
[img]http://codex.gallery2.org/images/9/95/Photoannotation_add_edit.png[/img]
An annotation linking to a tag
[img]http://codex.gallery2.org/images/4/43/Photoannotation_tag.png[/img]
An annotation with title and description
[img]http://codex.gallery2.org/images/1/18/Photoannotation_note.png[/img]




Features


  • Uses a modified version of jquery-image-annotate
  • Annotations are added and edited directly on the photo page
  • Annotations can be displayed below the photo
  • Tags can be added to a photo and/or created while creating an annotation
  • All annotation areas are displayed when hovering over the photo with the mouse
  • Titles and descriptions are shown when hovering over an annotation area
  • Tag- and user-annotations are click-able and will display the tag collection / user profile page
  • Users can be notified when someone tags a photo with them and/or adds a comment to a photo
  • "User cloud" block can be added to the sidebar showing users with tagged photos and allowing to search for users
  • Admin: Convert existing tag annotations (created with either Photo annotation or TagFaces module) can be converted to user annotations
  • Admin: When deleting a user, user annotation can be automatically converted to tag or note annotations





Installation


  • Download the module from this post
  • Extract the module to the module directory of your G3 install.
  • Activate the module: Login -> Admin -> Modules. Check the box next to the module. Click update at the bottom of the page.
  • If you are updating from a previous version, please run the upgrader (http://yourdomain/pathtogallery/upgrader
  • If you want to add the "User cloud" to your sidebar go to Login -> Admin -> Appearance -> Manage sidebar





Usage

  • On any photo page go to the Photo Options menu and click on "Add Annotation"
  • To delete an annotation, hover over it with the mouse and then click on the little "x" in the upper right corner of the annotation area
  • To modify an annotation, hover over it with the mouse and then click on the little pen in the upper right corner of the annotation area
  • To modify your notification settings go to your profile page (click on your name where it says "Logged in as") and click on "Edit"





Configuration


You can configure the module by going to Login -> Admin -> Settings -> Photo annotation




Version history


Version 1

  • Initial release

Version 1.1

  • Clicking 'Cancel' when editing an annotation would prevent viewing the image in full size
  • Theme now works with greydragon theme without modifications

Version 1.2

  • Fixed incorrect re-direct with "non-webroot-installs" and mod_rewrite activated
  • Fixed bug when re-activating the module
  • Fixed bug causing video pages not to display the video (not tested)

Version 2

  • Improved tag handling:
    • Drop down was replaced by ajax-textbox
    • Tags can now be added while creating the annotation
    • If a tag is entered which does not exist it will be created
  • When entering text in the tags textbox, the notes textbox is cleared and vice versa to avoid confusion
  • Added photoannotation.php provided by tkott to allow compatibility with the XMP module
  • Deletion confirmation dialog now looks better
  • Canceling deletion does not show the full size image anymore
  • Fixed positioning bug for RTL languages
  • Fixed bug when deleting an annotation when image contained annotations with same tag attached to them
  • Fixed tiny bug with positioning of the add / edit form

Version 2.1

  • Form is now hidden when resizing and dragging the annotation area
  • A few minor UI improvements

Version 3

  • Only beta releases (had to bump version number to 4)

Version 4

  • Increased initial size of the annotation area
  • Added possibility to associate users with annotations
    • Clicking on an annotation that has a user associated you will get to the user profile page
    • User profile page shows images of users
  • Added side bar block "People"
    • Displays all users with annotations
    • Allows to search for users
    • Admins can hide the block for guests
  • Added user notification
    • Users can decide if they want to receive notifications by editing their profile
    • Admin can decide if notifications is switched on by default for new users and users who have not saved this setting
    • Notifications will be sent out when a user annotation is created on a photo and/or if a comment is added to a photo with user annotations
  • Annotations can now be displayed below the resized photo (legend)
  • Hovering over the legend will now highlight the corresponding annotation
  • Added options to change annotation borders
  • Added admin option that allows to convert existing tag notifications to user notifications
  • Added admin option allowing to automatically convert a user annotation to a tag or note annotation when deleting a user
  • Added admin option to remove orphaned annotations (this can happen if a tag is deleted)

Version 4.1

  • Disable notification sending for new and updated comments if the commenter is the same as the user to be notified and notification module is active
  • First time installation would set the version number incorrectly to 3 instead of 4

Version 4.2

  • Fix undefined variable error

Version 4.3

  • Search now also searched in full name
  • Fix undefined variable error

Version 4.4

  • Fixed two JavaScript bugs in IE8

Version 4.5 / 5 beta 3

  • Fixed a bug where the user profile page would display empty thumbnails when a user doesn't have the right to see the photos

---
Build bridges not barriers.

AttachmentSize
photoannotationv4-5.zip77.68 KB
photoannotationv5b3.zip79.67 KB
 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Sat, 2010-08-28 16:18

EDIT (changed to the already created codex page)
Awesome!
http://codex.gallery2.org/Gallery3:Modules:photo_annotation

Is there a reason you're linking to the Navigation Carousel module in the installation instructions?
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
hukoeth

Joined: 2009-03-20
Posts: 127
Posted: Sat, 2010-08-28 16:23
nivekiam wrote:
Awesome! I've created a codex page for you to update as needed as well :)

Thanks. I already created one: http://codex.gallery2.org/Gallery3:Modules:photo_annotation sorry for that (forgot to put it in the post).

---
Build bridges not barriers.

 
hukoeth

Joined: 2009-03-20
Posts: 127
Posted: Sat, 2010-08-28 16:31
nivekiam wrote:
Is there a reason you're linking to the Navigation Carousel module in the installation instructions?

No good one anyway ;-)

Thanks for that I removed the link.

---
Build bridges not barriers.

 
hukoeth

Joined: 2009-03-20
Posts: 127
Posted: Sat, 2010-08-28 23:57

Version 1.1 can now be downloaded from the first post.

---
Build bridges not barriers.

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Sun, 2010-08-29 04:44

Just pulled your code into gallery3-contrib.
---
Problems? Check gallery3/var/logs
bugs/feature req's | upgrade to the latest code | use git

 
mamouneyya

Joined: 2009-11-02
Posts: 337
Posted: Sun, 2010-08-29 14:40

Bugs:

- RTL bug(s) (with Arabic language selected):
(1) The annotation square appears out of photo once you click on Add Annotation button. It's a trivial thing though, as you can easily drag it over the photo again.
(2) The first time you try to resize the annotation selection square, it is moved to the left side so it is get out of the photo in case you were in the middle or so.
(3) The text needs to be right-aligned for RTL languages.

- General bug(s):
(1) The module doesn't correctly redirect you when 'mod_rewrite' is enabled. Once I save the annotation, it redirects me to:

http://MySite.com/gallery/gallery/PictureXX

and I see the dang page.
(2) I activated the module and played with it for a while. After that I deactivated. Now, every time I try to activate it again nothing happens. The module page is refreshed without activating the Photo Annotation module. I see those lines in the log:

2010-08-29 17:33:03 +03:00 --- error: exception 'Database_Exception' with message '#1060: Duplicate column name 'description' [ ALTER TABLE items_faces ADD `description` varchar(2048) default NULL ]' in /home/****/public_html/gallery/system/libraries/Database_Mysqli_Result.php:27
Stack trace:
#0 /home/****/public_html/gallery/system/libraries/Database_Mysqli.php(79): Database_Mysqli_Result_Core->__construct(false, 'ALTER TABLE ite...', Object(mysqli), true)
#1 /home/****/public_html/gallery/system/libraries/Database.php(272): Database_Mysqli_Core->query_execute('ALTER TABLE ite...')
#2 /home/****/public_html/gallery/modules/gallery/libraries/MY_Database.php(45): Database_Core->query('ALTER TABLE ite...')
#3 /home/****/public_html/gallery/modules/photoannotation/helpers/photoannotation_installer.php(55): Database->query('ALTER TABLE {it...')
#4 /home/****/public_html/gallery/modules/gallery/helpers/module.php(218): photoannotation_installer::upgrade('1')
#5 /home/****/public_html/gallery/modules/gallery/controllers/admin_modules.php(89): module_Core::upgrade(Array, Array)
#6 /home/****/public_html/gallery/modules/gallery/controllers/admin_modules.php(51): Admin_Modules_Controller->_do_save('photoannotation')
#7 /home/****/public_html/gallery/modules/gallery/controllers/admin.php(62): Admin_Modules_Controller->confirm()
#8 [internal function]: Admin_Controller->__call()
#9 /home/****/public_html/gallery/system/core/Kohana.php(331): ReflectionMethod->invokeArgs(Array, Array)
#10 /home/****/public_html/gallery/system/core/Event.php(208): Kohana_Core::instance('modules', Array)
#11 /home/****/public_html/gallery/application/Bootstrap.php(67): Event_Core::run(Object(Admin_Controller), Array)
#12 /home/****/public_html/gallery/index.php(94): require('/home/****/pub...')
#13 {main}

Otherwise, the module is really promising. I am excited to get it working :)
Thanks!

 
hukoeth

Joined: 2009-03-20
Posts: 127
Posted: Mon, 2010-08-30 11:17

Hi there,
Thanks for testing :)

mamouneyya wrote:
Bugs:
- RTL bug(s) (with Arabic language selected):
(1) The annotation square appears out of photo once you click on Add Annotation button. It's a trivial thing though, as you can easily drag it over the photo again.
(2) The first time you try to resize the annotation selection square, it is moved to the left side so it is get out of the photo in case you were in the middle or so.
(3) The text needs to be right-aligned for RTL languages.

Ahh yes I expected there might be some problems with RTL but - sorry for that - didn't test on RTL language. I will look into this as soon as I have some time.

mamouneyya wrote:
- General bug(s):
(1) The module doesn't correctly redirect you when 'mod_rewrite' is enabled. Once I save the annotation, it redirects me to:

http://MySite.com/gallery/gallery/PictureXX

and I see the dang page.

Fixed (see first post)

mamouneyya wrote:
(2) I activated the module and played with it for a while. After that I deactivated. Now, every time I try to activate it again nothing happens.

Fixed (see first post)

mamouneyya wrote:
Otherwise, the module is really promising. I am excited to get it working :)
Thanks!

Thank you. Very glad to hear that.

From http://gallery.menalto.com/node/90183?page=1#comment-352077 :

engineer wrote:
I just download the latest gallery3 and modules in gallery3-contrib. If I enable the photo_annotation module, the video clip can't be played well, only blank in video clip area. rWatcher's TagFaces has no such problem. I prefer use the new photo annotation module cause the user interface is better. Does anyone has the same problem on playing video clip?

I can't test this right now but I think it should be fixed can you try with the version attached to the first post, please?
Regards,
Uli

---
Build bridges not barriers.

 
engineer

Joined: 2005-09-13
Posts: 84
Posted: Mon, 2010-08-30 12:02

http://gallery.menalto.com/node/90183?page=1#comment-352077
The "video clip can't play" problem is gone after I update to photoannotation v1.2.

However, I still find another strange problems. I will draw a picture to show them.

 
tkott

Joined: 2010-06-07
Posts: 225
Posted: Mon, 2010-08-30 21:14

Uli

WOWZA! Awesome work!

I found a minor bug: Clicking on the "X" to delete a tag, then pressing "cancel" goes to opening up the full item. (Latest git version)

Another request. My XMP module now can use either the tagfaces module (for backwards compatibility) or your great photoannotation module. However, for seamless integration, I need to add the photoannotation.php file to the helpers/ folder of your module. Would it be possible for you to just include the file in your module, saving users the need to copy the file specifically? The file is attached as a zip file (the forum won't let me attach otherwise).

Again, spectacular work, and thanks!

Tomek
----
Publish on Gallery 3 (WLPG Plugin) | XMP Module

 
hukoeth

Joined: 2009-03-20
Posts: 127
Posted: Tue, 2010-08-31 15:58

Hi all,
I have just uploaded version 2 to the first post of this thread. Please see the version history there for a detailed list of changes.

mamouneyya wrote:
Bugs:
- RTL bug(s) (with Arabic language selected):
(1) The annotation square appears out of photo once you click on Add Annotation button. It's a trivial thing though, as you can easily drag it over the photo again.

Fixed.

mamouneyya wrote:
(2) The first time you try to resize the annotation selection square, it is moved to the left side so it is get out of the photo in case you were in the middle or so.

Fixed.

mamouneyya wrote:
(3) The text needs to be right-aligned for RTL languages.

Partially fixed. I'm not 100% happy with the result since I would prefer to have e.g. the resize edge/corner at the bottom left etc. But text should be aligned correctly now.

From http://gallery.menalto.com/node/90183?page=1#comment-351728

mamouneyya wrote:
(1) Make the user able to add a tag directly from the annotate interface, instead of manually linking an already existed tag. That said, when you write a name in the Face field, Gallery automatically will add a tag using that name. That way there is no need to the drop-down tags list anymore.

Implemented.

mamouneyya wrote:
(2) Show the list of faces tagged in the photo below it, like Facebook way.

Already implemented with 1.2

tkott wrote:
I found a minor bug: Clicking on the "X" to delete a tag, then pressing "cancel" goes to opening up the full item. (Latest git version)

Fixed although not 100% ideal yet. I will look into a more "ajaxy" solution for the next version.

tkott wrote:
Another request. My XMP module now can use either the tagfaces module (for backwards compatibility) or your great photoannotation module. However, for seamless integration, I need to add the photoannotation.php file to the helpers/ folder of your module. Would it be possible for you to just include the file in your module, saving users the need to copy the file specifically? The file is attached as a zip file (the forum won't let me attach otherwise).

I added the file.

engineer wrote:
However, I still find another strange problems. I will draw a picture to show them.

OK let me know the details and I will have a look what's going on.

---
Build bridges not barriers.

 
engineer

Joined: 2005-09-13
Posts: 84
Posted: Tue, 2010-08-31 16:56

@hukoeth,

Finally I find the strange problem caused by Resize Protect module, not by photo annotation module. Please ignore it. Thank you for your awesome work to the great module. :)

 
tkott

Joined: 2010-06-07
Posts: 225
Posted: Tue, 2010-08-31 18:14

Great work Uli!

Everything works as far as I can tell!! Thanks for including my file.

Tomek
----
Publish on Gallery 3 (WLPG Plugin) | XMP Module

 
hukoeth

Joined: 2009-03-20
Posts: 127
Posted: Wed, 2010-09-01 09:23

Hello,
After using the module for a while I found that resizing can be a bit annoying because the form is in the way. I have therefore attached 2.1 to the first post which will hide the form while dragging and resizing the annotation area.

engineer wrote:
Finally I find the strange problem caused by Resize Protect module, not by photo annotation module. Please ignore it. Thank you for your awesome work to the great module. :)

Thanks for the feedback. Let me know if you see any other problems or incompatibilities.

tkott wrote:
Everything works as far as I can tell!! Thanks for including my file.

You're welcome. Glad to hear everything seems to be working. Thanks for testing.

Uli

---
Build bridges not barriers.

 
mamouneyya

Joined: 2009-11-02
Posts: 337
Posted: Wed, 2010-09-01 14:25

WOW, this is really becoming amazing.

hukoeth wrote:
Partially fixed. I'm not 100% happy with the result since I would prefer to have e.g. the resize edge/corner at the bottom left etc. But text should be aligned correctly now.

It will be cool if you could implement it this way. Otherwise, I am just satisfied :)!

Some suggestions:

- It's better, IMHO, to use the resize_bottom() function instead of photo_bottom() to show the face/note annotations. I know about your order module, but it is not because of the ordering. It's because I think that resize_bottom is more suitable position for such note. You can try it your-self.

- I really liked the Ajaxy auto suggestions for tag names. However, it would be awesome if you can make it more user connected. For now I am thinking of:
(1) Expand the suggestion source to include the usernames of Gallery existed users.
(2) Add a section to the user profiles to show any photo the user annotated in.

 
mamouneyya

Joined: 2009-11-02
Posts: 337
Posted: Wed, 2010-09-01 14:29

By the way, it seems that 'OK' and 'Cancel' buttons of the annotating form are not translatable.

 
hukoeth

Joined: 2009-03-20
Posts: 127
Posted: Wed, 2010-09-01 15:45
mamouneyya wrote:
WOW, this is really becoming amazing.
It will be cool if you could implement it this way. Otherwise, I am just satisfied :)!

I'm glad to hear that. I will definitely try to implement this but I can't promise your when because I would like to implement one of your other suggestions first :)

mamouneyya wrote:
- It's better, IMHO, to use the resize_bottom() function instead of photo_bottom() to show the face/note annotations. I know about your order module, but it is not because of the ordering. It's because I think that resize_bottom is more suitable position for such note. You can try it your-self.

I will give it a try. The closer it is to the photo the better IMHO so I think it makes sense.

mamouneyya wrote:
- I really liked the Ajaxy auto suggestions for tag names. However, it would be awesome if you can make it more user connected. For now I am thinking of:
(1) Expand the suggestion source to include the usernames of Gallery existed users.

This is a very cool idea (although I will need to change a lot of tags on my gallery if I implement this). I will think of some ways how to do this.
@bharat: Maybe this idea is worth implementing into the tags module what do you think? If you think it is I wouldn't mind to have a look how to do it.

mamouneyya wrote:
(2) Add a section to the user profiles to show any photo the user annotated in.

Nice idea as well.

mamouneyya wrote:
By the way, it seems that 'OK' and 'Cancel' buttons of the annotating form are not translatable.

Without checking: I think you're right. I will fix this with the next version.

Thanks for the feedback,
Uli

---
Build bridges not barriers.

 
tkott

Joined: 2010-06-07
Posts: 225
Posted: Wed, 2010-09-01 16:51
Quote:
mamouneyya wrote:

- I really liked the Ajaxy auto suggestions for tag names. However, it would be awesome if you can make it more user connected. For now I am thinking of:
(1) Expand the suggestion source to include the usernames of Gallery existed users.

Personally, I'm having a hard time figuring out how this is different from having good tags, since clicking on a tag takes you to a album of pictures that tag is used in. If pictures tagged well, and with the name of the person, then you would be all set without a need to expand the module. All it takes is setting up the tags in a useful way.

Am I missing something?

Tomek
----
Publish on Gallery 3 (WLPG Plugin) | XMP Module

 
hukoeth

Joined: 2009-03-20
Posts: 127
Posted: Wed, 2010-09-01 17:14

Hi Tommek
In a way I agree with you (this is how I use it at the moment) but I also would like to see more functionality for the user management to improve how users can interact etc. Implementing something like this would e.g. allow notifications if someone comments on a photo a user is on etc. I'm sure that some will like the idea and others rather use Facebook and co but I personally would like to have something like this.
Just my humble opinion though.

Uli

---
Build bridges not barriers.

 
tkott

Joined: 2010-06-07
Posts: 225
Posted: Wed, 2010-09-01 17:20

Ahh, yes. You are quite right that combining it with some sort of notification system would be difficult with just tags.

What if you simply linked a tag to a username (perhaps through a profile page). Then all you would need is a call to SQL "Find all profiles which have the following tag id associated with them". Then email said profiles. You would then stick to using tags as tags, and profiles as profiles. Seems cleaner IMO.

Tomek

----
Publish on Gallery 3 (WLPG Plugin) | XMP Module

 
hukoeth

Joined: 2009-03-20
Posts: 127
Posted: Wed, 2010-09-01 17:32

Sounds like a good approach I was thinking of something along these lines. For me the most important things are to keep it as simple and clean as possible and to make it configurable since I think not everyone would like to have this as default behaviour.
---
Build bridges not barriers.

 
hukoeth

Joined: 2009-03-20
Posts: 127
Posted: Sat, 2010-09-04 18:44

Hi all,

edit: Please find beta 2 three posts down.

Please find attached to this post beta 1 of version 3 of the module. It is not completed yet and I have made many changes so there are most likely a few bugs.

Please note that if you do install this version user profile pages will be overwritten and since this part is still under construction you will not be able to e.g. change your password, see your REST key etc.

Here are the changes:

  • Added possibility to associate users with annotations
  • Clicking on an annotation that has a user associated you will get to the user profile page (this page is still under construction)
  • Moved the legend to Resize_Bottom
  • Hovering over the legend will now highlight the corresponding annotation
  • Some UI improvements

If you want to try it please don't forget to run the updater after uploading the new version (http://yourdomain/pathtogallery/upgrader).

Please also be aware that this update will partially break the compatibility with the TagFaces module meaning that annotations with tags and notes associated will be displayed in both modules but annotations with users will only be displayed by the Photo Annotation module.

Regards,
Uli

---
Build bridges not barriers.

 
mamouneyya

Joined: 2009-11-02
Posts: 337
Posted: Sat, 2010-09-04 03:56

Very nice. However, I think the tagging interface needs some work here. First, it should be clearer that you have to enter *one* of the three annotation types (user, face, note.) Second, it should be clearer that you can always enter a description, despite what type of annotation you used. As a result, the three annotation types should be grouped together, while the description field should be isolated in the bottom of the interface.

Well. After some playing with 'Inspect Element' feature of Safari, I have got these results:
[img]http://grab.by/6ekt[/img]

The HTML code with the inline style attributes are:

<form id="photoannotation-form" action="/~mamoun/gallery3fork2/index.php/photoannotation/save/2" method="post" style="">
	<div style="background-color: #EEE; color: #4E7199; margin-bottom: 5px; padding: 6px 12px; height: 20px; ">
		<input type="hidden" name="csrf" value=removed for public display>
		<input type="hidden" name="noteid" value="1">
		<input type="hidden" name="notetype" value=
مستخدم:
			<select id="photoannotation-user-list" class="dropdown" style="float: left; width: 155px; " name="userlist">
				<option value="-1">...</option>
			</select>	
		</div>
		<strong>أو</strong>
			
		<br>
		<div style="background-color: #EEE; color: #4E7199; margin-bottom: 5px; padding: 6px 12px; height: 20px; ">
وسم:
			<input id="image-annotate-tag-text" type="text" name="tagsList" style="width: 155px; float: left; " value="" autocomplete="off" class="ac_input">
			<strong></strong>
			</div>
			<strong>أو</strong>
				
			<br>
			<div style="background-color: #EEE; color: #4E7199; padding: 6px 12px; margin-bottom: 15px; height: 20px; ">
ملاحظة:
				<input id="image-annotate-text" type="text" name="text" style="float: left; width: 155px;" value="">
		</div>

الوصف (اختياريٌّ):
		<textarea id="image-annotate-desc" name="desc" rows="3" style="width: 240px; margin-top: 3px; ">
		</textarea>
</form>

What you think?

 
hukoeth

Joined: 2009-03-20
Posts: 127
Posted: Sat, 2010-09-04 08:56

Hi,
Thanks for the feedback. I agree with you but I want to get the functionality right first. Besides the mentioned UI changes I also want to implement a few more settings etc. but only after the whole user annotation is sorted out.

Uli

---
Build bridges not barriers.

 
hukoeth

Joined: 2009-03-20
Posts: 127
Posted: Sun, 2010-09-05 20:26

Hi all,

edit: please find the latest beta in the post below

Changes from beta 1:

  • User profile page is now showing images of users and has full functionality
  • Added options how to display the annotation areas
  • A user can now be associated with only one annotation area per photo
  • Some UI improvements
  • Bugfixes

Todo:

  • Improve annotation area settings (feedback and suggestions are very welcome)
  • Allow to send e-mail notifications if a user is associated with an annotation area

If you are updating from version 2 or 1 please be sure to run the updater (http://yourdomain/pathtogallery/upgrader).
If you are updating from version 3 beta 1 please delete all old files before uploading the new ones since some were removed (if you leave those you will have difficulties with user profile pages).

Thanks in advance for testing.

---
Build bridges not barriers.

 
hukoeth

Joined: 2009-03-20
Posts: 127
Posted: Mon, 2010-09-06 15:29

Hello,

edit: please find version 4 beta 2 one post below.

Please find attached to this post version 4 beta 1 (I had to bump the version no.).

Changes from version 3 beta 2:

  • Implemented user notification (I need testers for this since for some reason my server is not sending mails with PHPs mail-function so I couldn't test)
    • Users can decide if they want to receive notifications by editing their profile
    • Admin can decide if notifications is switched on by default for new users and users who have not saved this setting
  • Guest user is now hidden when adding an annotation
  • Added admin option that allows to convert existing tag notifications to user notifications
  • Added admin option allowing to convert a user annotation to a tag or note annotation when deleting a user
  • Added admin option to remove orphaned annotations
  • Fixed borders not showing when hovering over an annotation area when having borders switched off on photo hover
  • Fixed issue on user page where sometime only one photo would be shown x-times
  • Fixed pagination on user profile pages

Please be sure to run the updater (http://yourdomain/pathtogallery/upgrader)

Regards,
Uli

---
Build bridges not barriers.

 
hukoeth

Joined: 2009-03-20
Posts: 127
Posted: Wed, 2010-09-08 15:49

Hello,
Attached to this post is version 4 beta 2. The reason why I am releasing this so shortly after beta 1 is that I found a few annoying bugs with the notification part (I managed to test it in the end).

Here some of the changes:
- Added admin option to customize the notification mails sent to the user
- Bugfixes
- Code cleanup

Hope someone can find some time to give it a try.

Uli

---
Build bridges not barriers.

 
hukoeth

Joined: 2009-03-20
Posts: 127
Posted: Wed, 2010-09-08 15:52

Version 4 RC can be downloaded from the first post. Changes from beta 2:
- Added sidebar block to display users with annotations and search for users
- Minified JS code
- Bugfixes

For a full list of changes see version history in the first post.

Regards,
Uli

---
Build bridges not barriers.

 
rlparadise

Joined: 2009-12-27
Posts: 65
Posted: Wed, 2010-09-08 17:47

I downloaded and tested v4b2 last night. Didn't notice any major issues. On the admin page, you had two checkbox options that looked to be identical for display tags below a photo. This may already be fixed in v4RC so I will try to test again tonight.

I did notice that one photo was flagged as "out of date" in my maintenance dashboard after working with annotations for a while. However, after trying to reproduce the problem a couple of different ways, I eventually just considered it an "anomaly".

I'll continue to test tonight and thanks again for all of your hard work.

 
hukoeth

Joined: 2009-03-20
Posts: 127
Posted: Wed, 2010-09-08 20:15

I'm glad to hear that thank you for testing. You are right about the check boxes. The first one should read "User annotations" and is not yet fixed.
I also need to implement a check to not send a notification if the notification module is active and a user has subscribed to that item and I also want an option allowing the admin to restrict user search to registered user. After that and if you guys don't find any other bugs I will release the final of version 4.

Thanks again,
Uli

---
Build bridges not barriers.

 
hukoeth

Joined: 2009-03-20
Posts: 127
Posted: Sat, 2010-09-11 20:16

Version 4 final is out and can be downloaded from the first post.
Changes from version 4 RC:

  • Admin option: disable people cloud for guest users
  • Removed the term user from front end
  • Notification is not being sent out if notification module is active and user is watching the photo
  • Fixed typo in admin area
  • Auto complete now works for username and user's full name
  • Increased initial size of annotation
  • Fixed bug where tags wouldn't save
  • Removed unnecessary line breaks in legend

For a full list of changes since version 3 please see first post.

---
Build bridges not barriers.

 
hukoeth

Joined: 2009-03-20
Posts: 127
Posted: Tue, 2010-09-14 09:25

Please find version 4.1 attached to the first post.
Changes:
- Disable notification sending for new and updated comments if the commenter is the same as the user to be notified and notification module is active
- First time installation would set the version number incorrectly to 3 instead of 4

---
Build bridges not barriers.

 
therat

Joined: 2009-10-08
Posts: 18
Posted: Fri, 2010-09-17 15:06

Hello hukoeth,

I think I found a bug with the latest experimental gallery3-3.0-rc-2-332-g3e1743b and latest photo annotation module ver. 4.1.
I've upgraded from previous git version.

When I switch on photo annotation module the sidebar disappears, also photo view doesn't show. When I turn it off everithing works normally.

Here is what I see in the logs when trying to open an album:
2010-09-17 08:01:36 -07:00 --- error: Undefined variable: user_array
#0 /home/rat/public/ratbook/modules/photoannotation/helpers/photoannotation.php(265): gallery_error_Core::error_handler(30)
#1 /home/rat/public/ratbook/modules/photoannotation/helpers/photoannotation_block.php(34): photoannotation_Core::cloud('photoannotation', Object(Theme_View))
#2 [internal function]: photoannotation_block_Core::get(Array, 'photoannotation', Object(Theme_View))
#3 /home/rat/public/ratbook/modules/gallery/helpers/block_manager.php(106): call_user_func('site_sidebar', Object(Theme_View))
#4 /home/rat/public/ratbook/modules/gallery/libraries/Theme_View.php(204): block_manager_Core::get_html()
#5 /home/rat/public/ratbook/themes/wind/views/sidebar.html.php(15): Theme_View_Core->sidebar_blocks('/home/rat/publi...', Array)
#6 /home/rat/public/ratbook/system/libraries/View.php(318): include('/home/rat/publi...')
#7 /home/rat/public/ratbook/system/libraries/View.php(260): View_Core->load_view(false, false, false)
#8 /home/rat/public/ratbook/modules/gallery/libraries/MY_View.php(69): View_Core->render()
#9 /home/rat/public/ratbook/system/libraries/View.php(226): View->render()
#10 /home/rat/public/ratbook/themes/wind/views/page.html.php(135): View_Core->__toString('/home/rat/publi...', Array)
#11 /home/rat/public/ratbook/system/libraries/View.php(318): include('/home/rat/publi...')
#12 /home/rat/public/ratbook/system/libraries/View.php(260): View_Core->load_view(false, false, false)
#13 /home/rat/public/ratbook/modules/gallery/libraries/MY_View.php(69): View_Core->render()
#14 /home/rat/public/ratbook/system/libraries/View.php(226): View->render()
#15 /home/rat/public/ratbook/modules/gallery/controllers/albums.php(79): View_Core->__toString(Object(Item_Model))
#16 /home/rat/public/ratbook/modules/gallery/controllers/albums.php(22): Albums_Controller->show()
#17 [internal function]: Albums_Controller->index(Object(Albums_Controller), Array)
#18 /home/rat/public/ratbook/system/core/Kohana.php(331): ReflectionMethod->invokeArgs(NULL)
#19 [internal function]: Kohana_Core::instance(Array, Array)
#20 /home/rat/public/ratbook/system/core/Event.php(208): call_user_func_array('system.execute')
#21 /home/rat/public/ratbook/application/Bootstrap.php(67): Event_Core::run()
#22 /home/rat/public/ratbook/index.php(97): require('/home/rat/publi...')
#23 {main}

And here is what happening when trying to open a photo and just a blank page is showing:

2010-09-17 08:03:23 -07:00 --- error: Undefined variable: noeditablehover
#0 /home/rat/public/ratbook/modules/photoannotation/helpers/photoannotation_theme.php(41): gallery_error_Core::error_handler(Object(Theme_View))
#1 [internal function]: photoannotation_theme_Core::head(Array, Array)
#2 /home/rat/public/ratbook/modules/gallery/libraries/Theme_View.php(273): call_user_func_array('head', Array)
#3 [internal function]: Theme_View_Core->__call()
#4 /home/rat/public/ratbook/themes/wind/views/page.html.php(71): Theme_View->head('/home/rat/publi...', Array)
#5 /home/rat/public/ratbook/system/libraries/View.php(318): include('/home/rat/publi...')
#6 /home/rat/public/ratbook/system/libraries/View.php(260): View_Core->load_view(false, false, false)
#7 /home/rat/public/ratbook/modules/gallery/libraries/MY_View.php(69): View_Core->render()
#8 /home/rat/public/ratbook/system/libraries/View.php(226): View->render()
#9 /home/rat/public/ratbook/modules/gallery/controllers/photos.php(55): View_Core->__toString(Object(Item_Model))
#10 [internal function]: Photos_Controller->show(Object(Photos_Controller), Array)
#11 /home/rat/public/ratbook/system/core/Kohana.php(331): ReflectionMethod->invokeArgs(NULL)
#12 [internal function]: Kohana_Core::instance(Array, Array)
#13 /home/rat/public/ratbook/system/core/Event.php(208): call_user_func_array('system.execute')
#14 /home/rat/public/ratbook/application/Bootstrap.php(67): Event_Core::run()
#15 /home/rat/public/ratbook/index.php(97): require('/home/rat/publi...')
#16 {main}

 
hukoeth

Joined: 2009-03-20
Posts: 127
Posted: Fri, 2010-09-17 15:22

Hi therat,
Thank you for reporting this. I most likely won't be able to have a look today but will do that over the weekends. I will keep you posted.

Regards,
Uli

---
Build bridges not barriers.

 
hukoeth

Joined: 2009-03-20
Posts: 127
Posted: Sat, 2010-09-18 09:47
therat wrote:
Hello hukoeth,

I think I found a bug with the latest experimental gallery3-3.0-rc-2-332-g3e1743b and latest photo annotation module ver. 4.1.
I've upgraded from previous git version.

When I switch on photo annotation module the sidebar disappears, also photo view doesn't show. When I turn it off everithing works normally.

Hi therat,
Can you please try version 4.2 attached to the first post. This should hopefully get rid of the error.

Regards,
Uli

---
Build bridges not barriers.

 
tkott

Joined: 2010-06-07
Posts: 225
Posted: Sat, 2010-09-18 13:54

Hi Uli,

Great improvements to the module, WOW! That's the way to write a module.

I have one favor: it looks like somewhere along the line the function "add" got dropped from helpers/photoannotation.php which my module XMP looks for when adding faces. Could you add that function back in? (listed below)

Thanks!

Tomek


  static function add($item, $tag_title, $description, $x1, $y1, $x2, $y2, $bTag) {
    if ( !$bTag &amp;&amp; !empty($tag_title) ) {
      try {
        //we are trying to add a note
        $newnote = ORM::factory("items_note");
        $newnote-&gt;item_id = $item-&gt;id;
        $newnote-&gt;x1 = $x1;
        $newnote-&gt;y1 = $y1;
        $newnote-&gt;x2 = $x2;
        $newnote-&gt;y2 = $y2;
        $newnote-&gt;title = $tag_title;
        $newnote-&gt;description = $description;
        $newnote-&gt;save();
      } catch (Exception $e) {
        Kohana_Log::add("error", "Error adding note annotation.n" .
                        $e-&gt;getMessage() . "n" . $e-&gt;getTraceAsString());
      }
    } elseif ( $bTag &amp;&amp; !empty($tag_title) ) {
      try {
        //we are adding a tag
        //first find the tag
        $tag = ORM::factory("tag")-&gt;where("name", "=", $tag_title)-&gt;find();
        //tag was not found
        if (!$tag-&gt;loaded()) {
          $tag-&gt;name = $tag_title;
          $tag-&gt;count = 0;
        }

        $tag-&gt;add($item);
        $tag-&gt;count++;
        $tag-&gt;save();
        //check if the tag is attached to the item
        // if the tag isn't attached, attach it
        //check if the face is already tagged
        $existingFace = ORM::factory("items_face")
                             -&gt;where("tag_id", "=", $tag-&gt;id)
                             -&gt;where("item_id", "=", $item-&gt;id)
                             -&gt;find_all();

        if (count($existingFace) == 0) {
          // Save the new face to the database.
          $newface = ORM::factory("items_face");
          $newface-&gt;tag_id = $tag-&gt;id;
          $newface-&gt;item_id = $item-&gt;id;
          $newface-&gt;x1 = $x1;
          $newface-&gt;y1 = $y1;
          $newface-&gt;x2 = $x2;
          $newface-&gt;y2 = $y2;
          $newface-&gt;description = $description;
          $newface-&gt;save();
        } else {
          // Update the coordinates of an existing face.
          $updatedFace = ORM::factory("items_face", $existingFace[0]-&gt;id);
          $updatedFace-&gt;x1 = $x1;
          $updatedFace-&gt;y1 = $y1;
          $updatedFace-&gt;x2 = $x2;
          $updatedFace-&gt;y2 = $y2;
          $updatedFace-&gt;description = $description;
          $updatedFace-&gt;save();
        }
      } catch (Exception $e) {
        Kohana_Log::add("error", "Error adding note annotation.n" .
                        $e-&gt;getMessage() . "n" . $e-&gt;getTraceAsString());
      }
    } else {
      throw new exception("@todo MISSING_TAG_OR_DESCRIPTION");
    }
  }

----
Publish on Gallery 3 (WLPG Plugin) | XMP Module

 
hukoeth

Joined: 2009-03-20
Posts: 127
Posted: Sat, 2010-09-18 16:53
tkott wrote:
Hi Uli,

Great improvements to the module, WOW! That's the way to write a module.

I have one favor: it looks like somewhere along the line the function "add" got dropped from helpers/photoannotation.php which my module XMP looks for when adding faces. Could you add that function back in? (listed below)

Thanks!

Tomek

Hi Tomek,
Thank you very much.
About the add function. I indeed removed it at one point (sorry completely forgot to contact you) but not with the intention to break compatibility with your module. I am happy to add it again but since I have rewritten the code to save annotations and moved it to helpers/photoannotation.php anyway may I suggest something else:

If I read your code correctly you create tags if they don't exist already during the import process and you only save annotations with tags (not notes or users).
Therefore you could call photoannotation::saveface($tag_id, $item_id, $str_x1, $str_y1, $str_x2, $str_y2, $description) to save the annotation with the benefit to not have redundant code. What do you think?

Uli

---
Build bridges not barriers.

 
tkott

Joined: 2010-06-07
Posts: 225
Posted: Sat, 2010-09-18 19:41

That's an even better idea. Sorry I didn't see that function before. I'll take a look at your code and make sure my module calls things correctly.

Thanks!

Tomek

----
Publish on Gallery 3 (WLPG Plugin) | XMP Module

 
tkott

Joined: 2010-06-07
Posts: 225
Posted: Sat, 2010-09-18 20:58

Uli,

My module now successfully points at your saveface function. Thanks for the heads up!

Tomek
----
Publish on Gallery 3 (WLPG Plugin) | XMP Module

 
hukoeth

Joined: 2009-03-20
Posts: 127
Posted: Sun, 2010-09-19 08:07

Hi Tomek,
Great work. Thank you for that

Uli

---
Build bridges not barriers.

 
therat

Joined: 2009-10-08
Posts: 18
Posted: Sun, 2010-09-19 17:02

Hello Uli,
Unfortunately the fix didn't resolve the missing sidebar.
The errors in logs however changed:

On album load:
2010-09-19 09:49:02 -07:00 --- error: Undefined variable: item
#0 /home/rat/public/ratbook/modules/photoannotation/helpers/photoannotation.php(45): gallery_error_Core::error_handler('g-user-cloud-fo...')
#1 /home/rat/public/ratbook/modules/photoannotation/helpers/photoannotation_block.php(35): photoannotation_Core::get_user_search_form('photoannotation', Object(Theme_View))
#2 [internal function]: photoannotation_block_Core::get(Array, 'photoannotation', Object(Theme_View))

On picture view load:
2010-09-19 09:49:27 -07:00 --- error: Undefined variable: legend_users
#0 /home/rat/public/ratbook/modules/photoannotation/views/photoannotation_highlight_block.html.php(108): gallery_error_Core::error_handler('/home/rat/publi...', Array)
#1 /home/rat/public/ratbook/system/libraries/View.php(318): include('/home/rat/publi...')
#2 /home/rat/public/ratbook/system/libraries/View.php(260): View_Core->load_view(false, false, false)

...
2010-09-19 09:49:27 -07:00 --- error: Undefined variable: item
#0 /home/rat/public/ratbook/modules/photoannotation/helpers/photoannotation.php(45): gallery_error_Core::error_handler('g-user-cloud-fo...')
#1 /home/rat/public/ratbook/modules/photoannotation/helpers/photoannotation_block.php(35): photoannotation_Core::get_user_search_form('photoannotation', Object(Theme_View))

And by the way I think that "Add anotation" button appeared in the photo dropdown menu. However nothing happens when I press it, no logs also.
It might be that something with my setup is not exactly right, or a gadget in the sidebar is messing with your module. I'll try to exclude some of the parts to see if the bar appears.

Thanks for your help, appreciated.

PS. Ok, I think I found it: the "Users" block is not working together with annotation module. Sidebar shows when anotation is switched on and Users block is excluded. However "Add annotation" button still doesn't work. Error that still persists on photo view is:
error: Undefined variable: legend_users

 
hukoeth

Joined: 2009-03-20
Posts: 127
Posted: Sun, 2010-09-19 17:50
therat wrote:
Thanks for your help, appreciated.

No thank you so much for testing and reporting this (and for the error logs which make fixing really easy :) ). There is nothing wrong with your setup but your PHP is set to report more errors than mine that's why I didn't catch them (I actually need to setup a test server since I have problems with all errors reporting on my hosted one for some reason).

In any case: I fixed the reported two errors (hopefully they are the last) which should also make the add annotation button work again. You can find the updated version as usual attached to the first post.

Thanks again,
Uli

---
Build bridges not barriers.

 
hukoeth

Joined: 2009-03-20
Posts: 127
Posted: Wed, 2010-09-22 13:58

Version 4.4 is out. This is only a bugfix release addressing two issues with the JS code in IE8. The new version is attached to the first post.

---
Build bridges not barriers.

 
hukoeth

Joined: 2009-03-20
Posts: 127
Posted: Thu, 2010-09-23 10:13

Hello,

Edit: beta 2 can be found attached to the next post.

Before you download please read the entire post.

Changes

  • Adding, deleting and modifying annotations is now realized completely with ajax and therefore does not require a complete page re-load anymore.
  • Fixed JavaScript bug in IE8 (back ported to version 4.4, see first post)

Please note that I have still not figured out how to disable the "show full size" link of the image when clicking on annotations or on the delete/modify areas. Therefor this version removes the link completely and places a little box at the upper left corner of the re-size allowing to view the photo in full size.
This is not optimal and I will continue to look for a solution but for those of you who don't mind please go ahead and give it a try since it makes adding annotations much faster.

Thank you in advance for testing,
Uli

---
Build bridges not barriers.

 
hukoeth

Joined: 2009-03-20
Posts: 127
Posted: Fri, 2010-09-24 11:54

Edit: version 5 beta 3 can be found attached to the first post.

The only change is a bugfix addressing the issue that the legend wouldn't show when adding the first annotation of any type to a photo.

---
Build bridges not barriers.

 
hukoeth

Joined: 2009-03-20
Posts: 127
Posted: Fri, 2010-09-24 11:53

Version 4.5 and 5 beta 3 can be found attached to the first post. Both address one bug:

  • Fixed a bug where the user profile page would display empty thumbnails when a user doesn't have the right to see the photos

Regards,
Uli

---
Build bridges not barriers.

 
therat

Joined: 2009-10-08
Posts: 18
Posted: Fri, 2010-09-24 14:13

Hello Uli,

Your latest fix solved my problem. Now annotation works :), thanks.

To have better error reporting I think you should research a option introduced earlier from the developers of the gallery framework. The logs I send you are generated in <galery root>/var/log/<date>.php

To enable this function I think you should create a file named
"local.php" in your gallery root with the following content:

<?
defined("SYSPATH") or die("No direct script access");
error_reporting(E_ALL);
ini_set('display_errors', true);
?>

But I might be wrong, I did that some time ago and don't remember very well ...

 
hukoeth

Joined: 2009-03-20
Posts: 127
Posted: Fri, 2010-09-24 14:24
therat wrote:
Hello Uli,

Your latest fix solved my problem. Now annotation works :), thanks.

Great! Glad to hear.

therat wrote:
To have better error reporting I think you should research a option introduced earlier from the developers of the gallery framework. The logs I send you are generated in <galery root>/var/log/<date>.php

Yeah it's not that unfortunately. If I switch on full error reporting kohana just shuts down with weird errors. I did a bit of research and it seems that it's server configuration that is causing this.
So I only have the options to ask my hoster to change that (which I doubt they will) or install a server on my home PC which I want to do at one point anyway.

But thanks for the heads up on this one.

Regards,
Uli

---
Build bridges not barriers.

 
mamouneyya

Joined: 2009-11-02
Posts: 337
Posted: Fri, 2010-10-01 09:59

Looks like I am a little picky. I am really getting annoyed that there is no space between the resized photo and the navigation buttons anymore. It seems your plugin replaces the resized photo div to disable the full screen click. There was padding of 2.2em on top/bottom of the resized photo.
BEFORE: [img]http://grab.by/6EpV[/img]
AFTER: [img]http://grab.by/6EpT[/img]

Also, for some reason, sometimes the close button appears not centered (*some*times, with *some* annotation!):
[img]http://grab.by/6EpR[/img]

Thanks! :)

 
hukoeth

Joined: 2009-03-20
Posts: 127
Posted: Fri, 2010-10-01 13:12
mamouneyya wrote:
Looks like I am a little picky.

Hi,
No it's OK. Bothering me as well. Thing is that I still haven't figured a good way of solving the issue with the full screen photo link so this is only a temporary solution. I've been busy over the last few days creating some documentation but I will start looking for a better way of doing this soon. If I have time this weekend I will modify the CSS file to add the margin again though.

Regards,
Uli

---
Build bridges not barriers.

 
clindsey

Joined: 2007-03-29
Posts: 15
Posted: Mon, 2010-10-11 01:43

Hukoeth, is it possible to tag a person that isn't a Gallery user? Thanks for this great extension!