Image annotation script (108)

1 Name: !WAHa.06x36 2005-03-25 14:24 ID:eYuLk9SR [Del]

Since I put it into testing over at the ABe board already, I might as well make a thread here to discuss my latest project.

In a nutshell, it's a script for putting notes on images. This is from an idea of whispers', about collaborative translation - several people can work on a translation by creating and editing notes for text on a comic page. There are probably other uses too, if someone can be bothered to think about them.

It's definitely not done yet, but it's open for public scrutiny for bug testing and to gather ideas for features it needs to be useful. Some signs of it being unfinished are:

  • No deletion of notes, and no reverting to older versions.
  • Lack of other unspecified backend features (for instance, discussion threads for each image)
  • It would be useful to have differently coloured notes, but that's not done yet.
  • Some newline issues with certain browsers. Not sure which ones, but that should be easy enough to fix.

Well, have a look. Try not to mess it up too badly. If you want to do some heavy testing, add a new image to work on.

59 Name: Anonymous 2005-05-14 15:41 ID:wv8oaJF/ [Del]

I think it would be better if the projects announced on the frontpage got a specific (UNIX timestamp?) value assigned to them over which you could access them even without the (original) image URL.

60 Name: htsuji 2005-05-15 23:29 ID:wlC8YFVE [Del]

Perhaps we should just copy the picture in somewhere before starting the translation, instead of introducing complicated methods.

61 Name: htsuji 2005-05-17 11:25 ID:wlC8YFVE [Del]

Does your browser display the picture of this?

My IE6 and Firefox1.0.3 don't, even though the image file itself can be reachable via

Strangely, after I access this URL, the former page also works. And when I click the reload button of the brower, the image disappears again.

Seemingly this happens only when the image file is stored in the image board of iitran.

Possibly... redirection does something.

62 Name: Anonymous 2005-05-17 12:19 ID:Heaven [Del]

Perhaps they made some changes to's antileeching and inadvertently cut off access?

63 Name: !WAHa.06x36 2005-05-17 17:36 ID:KeNZSLQJ [Del]

Yes, that's it. I'll talk to squeeks about it.

64 Name: !WAHa.06x36 2005-05-28 15:44 ID:KeNZSLQJ [Del]

Fixed a small bug that prevent the script from working in Safari. Hooray.

65 Name: !WAHa.06x36 2005-05-29 11:14 ID:KeNZSLQJ [Del]

I made a quick little addition of a feature that may turn out quite useful:

If you open a note and click "More...", there's now a "Rikai" button to open up a new window with the contents of the note run through's popup translator. This will give you a popup window containing a translation of words when you hover over kanji on the page. This should make translation work a lot easier for those of you (ok, ok, us) who haven't managed to memorize many kanji.

Check it out, and remember to shift-reload to get the new Javascript file for this.

66 Name: Anonymous 2005-05-30 02:03 ID:Heaven [Del]


That's a pretty nifty addition!

67 Name: apple 2005-06-17 17:47 ID:jOS1OGg/ [Del]

Popping over from the other board as directed :D

I'm still interested to test the script out. Looks like the perfect <strike>toy</strike>tool between my friends and I when we do some random translations.

Any chance of releasing the source a little early? (;´Д`)

68 Name: !WAHa.06x36 2005-06-17 20:05 ID:KeNZSLQJ [Del]

Well, I packed up the current version here:

Should be straightforward enough to get running. Just edit to put in the proper settings for your SQL database. I've tested it with mysql and SQLite. Also, there is a risk that future versions will be incompatible with this one, so that's the risk you take running unfinished software.

69 Name: apple 2005-06-18 00:32 ID:jOS1OGg/ [Del]

Grabbed it, thanks! I got it running on my side now and am in the process of reading thru the code. I'm still new to xml-http requests.

Anyway, I was going thru the older topics and wanted to throw in some input:

1) Regarding individual projects and all, there's always the quick-n-dirty way of introducing a new field in the table containing the project name, and let mysql group the entries by it, then output them sorted. I thought creating a few new tables just for that purpose might be a little overkill. After all, the front page just outputs everything in db anyway.

... but then everyone will want more extended features later so introducing new tables might be good (*´¬`)

2) An additional "Save" option on the menu which saves the positions only (or perhaps all info for the image) might be nice. When I was fiddling with it, I would often move the note away from the original spot just to refer to the image and then forget to move it back after I started on the next. Then I find a few of the notes are scattered around after saving the last one. And I'd end up re-saving a note without making any changes just to update the new positions.

3) This may not be practical for everyone, but how about introducing an export feature? Ie. output all notes for the current image into a text file. For what purpose? Well now ... collaborative translation is interesting but it might be nice to be able to save the text if we're working on one project instead of just random images :D

70 Name: !WAHa.06x36 2005-06-18 05:44 ID:KeNZSLQJ [Del]

  1. I've considered doing something like that, too.
  2. I've seldom found that a problem in normal use, so I haven't seen a need for it...
  3. This is something I have wanted too, but there's one big unsolved problem: In what order would you print the notes? None of the easy orderings are useful (by creation date, by last edit...). Adding a manual ordering attribute is really far too much work.

71 Name: apple 2005-06-18 09:33 ID:jOS1OGg/ [Del]

Re 3: Hmm, you don't think the creation date would be adequate? I think that in the practical sense, new notes would be added in sequence.

My initial idea was to introduce a variable to keep track of the count of the notes. So creating a new note would increase/assign that number to the current note. But yeah, if someone wants to re-order things, that would be too much work.

Initially, I wanted to try adding some features I'd like to the script, then I found out that the bulk of the script's operation was in Javascript, rather than in Perl. This is going to be hard =_=

72 Name: !WAHa.06x36 2005-06-18 13:51 ID:KeNZSLQJ [Del]

Well, I know I don't always create them in order. Actually, I seldom do, I start out with the easy ones. And if you later delete and add notes, it messes everything up. So that's not very useful...

73 Name: Anonymous 2005-06-18 18:05 ID:Heaven [Del]

I don't know much about Perl so I have no idea how feasable this might be, but what about a mode where you might "drag and drop" notes into an export bucket, and then have it generate a text file based on the order of placement in said bucket?

74 Name: apple 2005-06-18 18:12 ID:jOS1OGg/ [Del]

Hmm, how about this?

Each new note has a visible & editable text field containing the count, which increments by 10 (or whatever) each time.

Note A: 10
Note B: 20
Note C: 30
Note D: 40

So when they want to export the image and need to rearrange the notes (whether it's new notes or deleted ones), they can enter anything between the number for both notes and it'll be sorted ascendingly at the end.

So to push Note D between B & C, they change the number to something between 20-30. And there's more than adequate space to move other notes in between the two (and recursively)...

75 Name: !WAHa.06x36 2005-06-18 18:36 ID:KeNZSLQJ [Del]

>>74 is really too complicated and arbitary.

>>73 might be on to something, though...

I wish I had SVG, because then I could make a system for drawing connections between notes with lines. That would be truly intuitive.

76 Name: I am Japanese 2005-07-29 04:06 ID:MhheezCO [Del]

>If you can come up with some good suggestion for an official name, feel free to post it in the thread linked in >>7

I'm Japanese.
So, I suggest some Japanese name.
(Because I can't suggest cool name with English.)

ザ・翻訳(Za・HONYAKU) (The・trastlations)
翻訳コンニャク(HONYAKU KONNYAKU) (Translation of devil's tongue jelly.)
(This is name of Doraemon's Item.
翻訳今夜食う? (HONYAKU KONYAKUU?) (Do you eat translations tonight?)

77 Name: Anonymous 2005-07-29 05:19 ID:KiEuP3Vd [Del]

I tried running notes on Dreamhost, but it wouldn't. All .pl-files were CHMOD'ed 755.

Invalid [] range "}-\x" before HERE mark in regex m/([\x{100}-\x << HERE {ffff}])/
Compilation failed in require at line 3.
BEGIN failed--compilation aborted at line 3.
Compilation failed in require at line 12.
BEGIN failed--compilation aborted at line 12.

78 Name: Anonymous 2005-08-01 23:06 ID:+OAmsJUm [Del]

On dealing with expiring images, how feasable would it be to have a menu item where you enter a URL or local machine pathname to temporarily replace the background image? Something that would load only for your own session without requiring modifications to the database.

Or a list of URLs where people can add alternate locations to the original file, then switch between them in the same way wakaba/kareha switch between board looks?

79 Name: !WAHa.06x36 2005-08-02 06:38 ID:LJ4Deanq [Del]

>>77 requires Perl 5.8, Dreamhost only has 5.6. This is just a side project, so I probably won't work around this anytime soon.


This sounds like a pretty good solution. I am not sure how easy it is to get at files locally (might be prevented for security reasons), but it's not a bad idea overall. I'll look into it (at some point).

80 Name: dmpk2k!hinhT6kz2E 2005-08-04 22:39 ID:rr4c3EHL [Del]

Some good news is that DreamHost is upgrading (from Woody to Sarge), so Perl will finally be 5.8.

81 Name: a decayed japanese 2005-09-09 00:49 ID:lbarLJtF [Del]

save/update がうまくいかないようでこまっています
もし可能でしたら、offline mainで動いて、最後に一括saveできるような

from japan and with my ISP, got network trouble often.
seems timeout during save and update.
can you make this tool working on offline mainly and possible save collectively.

82 Name: !WAHa.06x36 2005-09-09 09:42 ID:KeNZSLQJ [Del]

Ah, I see. It would be a lot of work to do that, though, and I am always busy (and lazy). If you have your own webhost somewhere that can run Perl scripts, you could set up your own copy where it would be easier to reach, maybe? If you want to try that, you can download

83 Name: a decayed japanese 2005-09-09 21:26 ID:HRhwhFsN [Del]

thank you responce, I'll try

84 Name: htsuji 2005-09-13 21:30 ID:wMXDQ60i [Del]

May I borrow the script?
My ISP offers its customers some MySQL servers which are accessible from its web servers (and Perl 5.8 is also available). I never used any SQL servers, but perhaps what I should do is to replace 'host=localhost' and 'user/pass' in with some appropriate names.

85 Name: !WAHa.06x36 2005-09-14 06:04 ID:LJ4Deanq [Del]

Yeah, that should work.

Incidentially, I've been meaning to put in a quick hack for better organization of the front page by grouping pages by domain name and path. It's getting a bit hard to find stuff in there now. But first I've gotta finish this other stuff I'm working on... orz.

86 Name: htsuji 2005-09-15 06:01 ID:T2LRmLtI [Del]

It worked. Thanks.

I simply used Javascript's sort method of an array object to sort the front page's items. A script in "./notemenu.html" sorts "li" DOM objects at the result of "".

This is only a trail. My script sometimes does strange action. I'll make this better.

a decayed japanese, I'm going to install the tool in my web site. Perhaps the server has fewer visitors than wakaba has, so the new page gives you fewer timeout, I guess.

87 Name: a decayed japanese 2005-09-18 04:47 ID:M8mlcHE3 [Del]

oh thank you htsuji.
can I borrow your page ?
I tryed but couldn't setup thingy tool to some my web space :/

88 Name: htsuji 2005-09-18 10:26 ID:s6360+9e [Del]

Sure. Though it is yet testing phase.

I mean to set two or three entry pages -- at least, for general mangas (for all ages) and for special ones.

By the way, picture files in Gurochan aren't accessible if they are referred from my site or other outside of Gurochan except that original thingy page. The image of Gurochan you see in my site is a cached data in your web browser.
(see also >>61-63)

> I tryed but couldn't setup thingy tool to some my web space :/

The script requires an SQL database engine (for example MySQL, SQLite) to store notes. Once upon a time, you must pay additional charge when use an SQL server with your web site, and almost all of SQL servers were very expensive. Thanks to today's blog boom, some ISPs now offer one or more simple SQL engines to their personal customers because some popular blog softwares need them. I guess your ISP might prepare "DBI:SQLite module" for its users, which is a perl library with an embedded SQL engine that runs as a part of Perl(CGI) programs.

Anyway, I'll fix my site in a few days.

89 Name: htsuji 2005-10-01 02:31 ID:EhnYMSmX [Del]

This might be just my imagination, but when notes.js running in the browser requests a lot of notes icon images to the web server at once, the server's TCP wrapper or something that watching DoS attack blocks most of the connection. The browser receives only 4 or 5 icon images. After a while (for several minutes) the server keeps refusing to connect any connection (not only port 80 but also port 23, 25 etc) from the ip address of the pc where the browser is operating.

90 Name: Anonymous 2005-10-01 03:34 ID:Heaven [Del]

>browser requests a lot of notes icon images

I don't think. Stock config in firefox only requests 8 documents at once from a server.

91 Name: htsuji 2005-10-01 11:20 ID:GShsSqpU [Del]

I tried with IE6.0, Firefox 1.07, and Opera8.5.

Firstly I cleared each browser's cache. (if caches are already filled with icon images, this "resusal by the server" doesn't happen.)

When I use IE, it happens more frequntly.
It it rare with Firefox and Opera. (not never)

When I limit Opera's maximum connection to 1 or 2 (or maybe 4), it seemingly never happens, and when I set the limit to 16, it almost always happens.

I don't know either how my ISP set the server or the current load on the server, so I'm not sure what I wrote in 89 yet...

92 Post deleted by user.

93 Post deleted by user.

94 Name: htsuji 2005-10-01 12:03 ID:5TEsRX3T [Del]


The firewall in MY router does! Not ISP nor the web server.

I found my router's log reports "SYN flood to HOST" from my pc.
Then I turn off the router's firewall function, the problem doesn't happen even I set opera's maximum connention count to 16. I'm sorry.

95 Name: Anonymous 2005-10-01 12:52 ID:Heaven [Del]


97 Name: Anonymous 2005-10-01 15:15 ID:6P9sLwVf [Del]


Reminds me of the times I spent hours trying to get Windows Networking to work when I should have just configured my firewall correctly. And yes, that was two separate occasions...I didn't learn the first time.

98 Name: htsuji 2005-10-01 17:01 ID:Heaven [Del]

By the way, I wrote:

> the problem doesn't happen even I set opera's maximum connention count to 16.

Opera has other problems and doesn't work correctly after all.
"the problem" means a network problem I encountered. I only used Opera to get any hint.

I should have checked my network at first... <sigh>

99 Name: Anonymous : 2006-04-13 05:46 ID:32FGIhyJ [Del]


>mouseover reveal
>Seems far too epilepsy-inducing. I've been considering single-click reveal, though.

Perhaps mouseover reveal after a timeout?

100 Post deleted by moderator.

101 Name: Anonymous : 2007-04-08 07:35 ID:3j60E0+u [Del]

Imagine if this were just a Firefox plugin so that you could do it to any image on the entire internets without having to leave the site...

102 Name: Anonymous : 2007-04-10 19:50 ID:Heaven [Del]

we have incorporated into one of our wakaba boards. check it out here:

103 Name: ahh : 2007-06-14 04:38 ID:b5sFOuoD [Del]

no "how to config" board or post :/

104 Name: Anonymous : 2009-03-20 15:53 ID:lsqjmNdM (Image: 108x150 jpg, 6 kb) [Del]

src/1237589584110.jpg: 108x150, 6 kb

105 Name: Anon-i-Mouse : 2012-09-06 04:06 ID:370RzM6q [Del]

I think this script is pretty damn cool and I'd hate to necropost. Oh well, I wanted to know if you have to use a new SQL DB for each install of Notes? Notes isn't quite that documented it seems.

I'm guessing that you need to get in a browser and head to
.../ just like .../ where it then creates the HTML everyone can view?

I hope I'm right.

This is a cool script and I could eventually find a bunch of uses for it.

106 Name: Anon-i-Mouse : 2012-09-09 08:16 ID:DiNlBxQn [Del]

Just asking a bunch of stupid questions for a PDF I'm writing. so I may have more noob questions.

107 Post deleted by user.

108 Post deleted by moderator.

Name: Link:
Leave these fields empty (spam trap):
More options...