2010. október 27.

Working in Imagemagick

Clearing margin area

I'm working on a scanned text page, that needs a cleanup on the margins.
the original image size is 2736x3928 and it's a pbm file.
~$ convert orig.pbm -crop 2320x3928+120+0 crop.pbm
this cuts down 120 pixels from the left side, and 2736-120-2320=296 pixels from the right side.
~$ convert crop.pbm -bordercolor white -border 296x0 -gravity none -crop 2736x3928+176+0 back.pbm
this puts back the cut-down border in the color white. (first we add a 296 pixel wide border to both sides, which makes our image 296+296+2320=2912 wide. we only need the 296 border on the right side, so we crop the one on the left to be 120 px with 296-120=176 pixels. check: 2912-176=2736 we counted right.)

You have to do this 2 step separately. You can use mogrify instead of convert to edit multiple files, but ALWAYS make a backup copy of your files before using mogrify!

That's it. Enjoy.

2010. október 6.

Still on my to-do list

The only serious problem remains the Eraser jumping around.
I already reported this bug, and I don't seem to be alone with it. You can find out more about it here: https://bugs.launchpad.net/ubuntu/+source/xf86-input-wacom/+bug/588435

I want the scroller back! (Success!)

The TC4400 has a jog dial for pgup/pgdn on the side of the screen. The last time it worked out of the box was (when I used it) Gutsy Gibbon.
Recently I tried it, and it works in Hardy Heron also, where the wacom stuff doesn't work o-o-t-b.

Today I had to skip a class to get back my scroller, but at least it payed off. It was a lot easier than I thought. My bad luck was that I'm just a windows-user and not a linux-guru.
Here's how it works:

xev - "print contents of X events" - is the command to check, which button moves which key. The jog dial wasn't recognized in xev.

dmesg - "print or control the kernel ring buffer" showed me what is happening behind the screens.

It said:

[ 218.438785] atkbd.c: Unknown key pressed (translated set 2, code 0x87 on isa0060/serio0).
[ 218.438791] atkbd.c: Use 'setkeycodes e007 ' to make it known.
[ 218.479875] atkbd.c: Unknown key released (translated set 2, code 0x87 on isa0060/serio0).
[ 218.479881] atkbd.c: Use 'setkeycodes e007 ' to make it known.
[ 218.819908] atkbd.c: Unknown key pressed (translated set 2, code 0x86 on isa0060/serio0).
[ 218.819915] atkbd.c: Use 'setkeycodes e006 ' to make it known.
[ 219.041670] atkbd.c: Unknown key released (translated set 2, code 0x86 on isa0060/serio0).
[ 219.041678] atkbd.c: Use 'setkeycodes e006 ' to make it known.

for moving the jog dial "up" and "down" ways.

As for setkeycodes it wasn't so trivial. The "keycodes" doesn't match any keycode that xev gives back, so I tried from 1 to 109 until I found the keys I was looking for. (104: Prior; 109: Next)

In the end, for me the following command solved the problem:

sudo setkeycodes e006 104
sudo setkeycodes e007 109


I don't know if this affected my success, but I did a
sudo modprobe hp-wmi

and I left it like that. I wanted to get the 'sudo modprobe tc1100-wmi' work, but I couldn't, and that's how I accidentally found real soultion.

By the way these were the keycodes for moving:
102: Home
103: Up
104: Prior
105: Left
106: Right
107: End
108: Down
109: Next

To make the changes permanent you'll have to add the setkeycodes lines without the sudo to the /etc/rc.local before the "exit 0".