Ticket #32 (assigned enhancement)

Opened 16 months ago

Last modified 11 days ago

Sending Ink

Reported by: dx Owned by: kevincampbell
Priority: normal Milestone: 1.1
Component: p2p Version:
Keywords: ink handwriting gif isf Cc:

Description (last modified by dx) (diff)

  1. Protocol part (dx, needs rewrite)
  2. GUI part (alencool, done)
  3. Gif encoder (jandem, dx, done)
  4. ISF encoder/decoder (kevincampbell, almost ready)
  5. ISF renderer (alencool's drawing widget, done)

Attachments

isfencodings.py (1.3 kB) - added by kevincampbell 9 months ago.
functions to decode multi byte integers
pyisf.py (4.6 kB) - added by kevincampbell 9 months ago.
the main function to read an isf file (filename at the bottom can be changed)
isfencodings.2.py (2.4 kB) - added by kevincampbell 9 months ago.
functions to decode/encode multibyte integers
pyisf.tar.gz (7.4 kB) - added by kevincampbell 9 months ago.
new code, archived with examples
python_ink.tar.gz (42.9 kB) - added by kevincampbell 8 months ago.

Change History

Changed 16 months ago by dx

  • status changed from new to assigned
  • description modified (diff)

Changed 16 months ago by dx

  • type changed from defect to enhancement
  • component changed from emesenelib to p2p

Someone should start working in the GUI part after the next .tar.gz release, I don't know how to do that kind of changes...

Changed 15 months ago by dx

next .tar.gz release == now

Changed 15 months ago by mark.baas

Maybe we can do the gif encoder with PIL. The ink should be a plugin, so if pil isnt installed it won't be enabled.

Changed 15 months ago by dx

I'm working in a native (python) gif encoder. Ink is a core msn feature, we shouldn't implement that as a plugin. And PIL is big and ugly.

Changed 14 months ago by dx

  • milestone changed from 1.0 to 1.1

leaving for 1.1

btw, matz sent me a patch with the GUI part (Couldn't test it, but i think it's fine)

Changed 13 months ago by dx

  • milestone changed from 1.1 to 1.0

lzw encoder/decoder done

i think we can ship this with 1.0

Changed 13 months ago by ariel-zarzamora-com-mx

GIF patent is dead, great!! Emesene can bunldle it with no licence issues for those puritans (debian?)

Changed 12 months ago by dx

jandem fixed the giflzw encoder, so pygif is done -- that was the hardest part

ink is very close now..

Changed 11 months ago by dx

r970, uploaded initial GUI part.

Changed 11 months ago by dx

alen is working in a better drawing GUI

gtk.gdk.pixbuf > pygif done

Changed 11 months ago by dx

  • keywords isf added
  • description modified (diff)

implemented sendInk method in r981, but found what i was fearing... we have to implement ISF.

the official client already requires journal viewer to send ink, because that provides:

  • a drawing widget control
  • ISF reading/drawing apis

without journal viewer, they can receive GIF files, but if journal viewer is installed, gif data is ignored, and they expect ISF data in a gif comment block

pygif isn't useless, we can use it to resize gif animations (#173) or to send ink to clients with 0x4 clientid flag.

this wiki page ISFResources provides resources, links and plans on the ISF implementation. (it was a longterm feature when i created it....)

Changed 11 months ago by dx

  • description modified (diff)

Changed 11 months ago by dx

  • milestone changed from 1.0 to 1.1

bye :(

Changed 9 months ago by kevincampbell

functions to decode multi byte integers

Changed 9 months ago by kevincampbell

Hey, I've never done any real python programming, and I'm a mathematics and engineering student who was looking for something to do while bored, so I took a look through that wiki page and through the pygif library to get an idea of where to start at decoding some ISF images.

I implemented some python functions to decode all the multi-byte integers and stuff, and I'm working on some of the other encoding schemes. As it is now, it can identify the tags in the image, and identify what is the data from a stroke, but I ran into some issues with the 'Packet' data structures. There seems to be an additional mystery byte before the tag byte that's got me stumped.

Its interesting to me, so i'll be continuing to pluck away at some of the stuff, and once that's done, it should be pretty easy to store them in a stroke object similar to what's in the drawing widget code in emesene, and then simply draw it using cairo. I'm going away for a couple days for some new year's partying, so I thought i'd throw the code up here if anyone's interested in looking at it, and I'll be back in a couple days!

If anyone has already gotten this far, then oh well, it was interesting anyways, but if not, maybe this will help someone! (i'm attaching it using the attach button at the top, I hope that's right... if not, well, when I get back i'll stick it on the forum)

Changed 9 months ago by kevincampbell

the main function to read an isf file (filename at the bottom can be changed)

Changed 9 months ago by kevincampbell

functions to decode/encode multibyte integers

Changed 9 months ago by kevincampbell

Sorry, I was just writing the encoding functions for multibyte ints, and I noticed a mistake in the decoding functions, so I uploaded a new one with fixed decoding and new functions for encoding! But I can't delete the old one, so feel free to do so...

Changed 9 months ago by kevincampbell

Just an update, I've got a lot more code written, but its not anywhere near clean enough for me to put up yet :) I don't think its reasonable to expect a fully compliant ISF reader: the format is not documented at all, and the RE's stuff is incomplete at best. I do however think that I'm fairly close to having a rudimentary ISF writer, with a decoder capable of decoding something that the writer wrote. Next week I'll finally have access to a Windows computer to test more stuff on, so hopefully that'll help.

Anyways, correct me if I'm wrong, but we can have a client ID flag that tells WLM to send us fortified GIFs, while we send it ISF files right? If thats the case, we could have a basic ISF encoder to send ink to WLM, and still receive GIFs to decode with pygif. If this is possible, I think its the most reasonable route to take.

Changed 9 months ago by dx

Great work. I haven't read all the code, but that isfencodings module seems redundant. The struct module allows handling signed/unsigned 32 and 64 bits

Quoting this http://docs.python.org/lib/module-struct.html:

Standard size and alignment are as follows: no alignment is required for any type (so you have to use pad bytes); short is 2 bytes; int and long are 4 bytes; long long (int64 on Windows) is 8 bytes; float and double are 32-bit and 64-bit IEEE floating point numbers, respectively.

I'll read the main pyisf module now (and the other comments)

Changed 9 months ago by dx

whoops, the wiki markup made that underlined

Changed 9 months ago by dx

ok... let's see

  • four space indents as per PEP 8 http://www.python.org/dev/peps/pep-0008/
  • the decode function is too dense, the if/elif block is too long
    • consider a dict {tag: handler} where tag is the tag number and handler is a reference to the function
    • Example: handlers = {1234: self.function})
  • use constants instead of magic numbers (constants are just global vars with uppercase names, just like those tag names)
    • Example: TAG_POINT_PROPERTY = 12
    • The corresponding entry in that handlers dict could be like this: handlers[TAG_POINT_PROPERTY] = self.handle_point_property
  • avoid duplicating code (even if it's just a line), that will be easier after splitting that in many functions
  • use pylint a lot and try to get 10.0
  • yes, i noticed that what you've uploaded is highly experimental

Changed 9 months ago by kevincampbell

alright, here's the rewritten code!

Yeah, the old code was really dirty and experimental, so with this code I started with pygif as an example, and then proceeded to massacre it :D

I fixed the indenting, changed the decode function, used a list instead of magic numbers, and split it up much more.

So, there are a couple included files in the directory, feel free to play around and make any suggestions!

I'm working on the encoding aspect of things now for the next couple of days.

Changed 9 months ago by kevincampbell

new code, archived with examples

Changed 8 months ago by kevincampbell

Changed 7 months ago by kevincampbell

Holy crap, well that helps a lot!

I've ben MIA for a while now, crazy amounts of work... but I should have some time in the next couple of weeks to do a little more hacking, hopefully get it up to a state that its usable!

Changed 6 months ago by dx

  • description modified (diff)

Uploaded the last attachment to svn, and just tested, it works nice

Changed 6 months ago by kevincampbell

Hey there, I'd just like to say I'm still alive and I wish I could have had more time to work on this lately. The end of 4th year engineering is pretty busy...

So yes, I'm done exams next Tuesday, and I should be back for good then at the latest! I just need to fix bugs in my binary stream creator, other than that it should be good enough for basic encoding, and colours shouldn't be hard to implement with the full spec out.

Changed 4 months ago by music_love931

As what I know this lexmark is one of the largest and known manufacturer of quality and good printers and the price also is very affordable.Great printer toner and ink cartridge deals, discounts and coupons. _ Josie Smith Save up to 65% on ink from HP, Epson, Lexmark, Canon & other major printer ink brands from ConcordSupplies?.com http://www.concordsupplies.com

Changed 3 months ago by C10uD

  • owner changed from dx to kevincampbell
  • status changed from accepted to assigned

thanks for the spam...any news from kevin? ;)

Changed 11 days ago by NilPill

Any updates on this? I've been looking forward to seeing a good, linux-compatible MSN client capable of half-decent ink support for a very long time, and I can't wait to see this finished. Keep up the good work!

Add/Change #32 (Sending Ink)

Author



Action
as assigned
 
Note: See TracTickets for help on using tickets.