Friday, March 28, 2008

fone review write

Warning: geeky road ahead!

I copied a bunch of files from my camera to my NetBSD workstation:

-rwxr-xr-x 1 root wheel 983257 Mar 26 14:30 DSCN2540.JPG
-rwxr-xr-x 1 root wheel 1017349 Mar 26 14:39 DSCN2541.JPG
-rwxr-xr-x 1 root wheel 1011146 Mar 26 14:39 DSCN2542.JPG
[...]
-rwxr-xr-x 1 root wheel 1019327 Mar 27 14:37 DSCN2549.JPG
-rwxr-xr-x 1 root wheel 1012489 Mar 27 14:38 DSCN2551.JPG
-rwxr-xr-x 1 root wheel 977289 Mar 27 14:39 DSCN2552.JPG


And they are transformed:
-rw-r--r-- 1 jim wheel 14 Mar 28 05:07 phone-20.pam
-rw-r--r-- 1 jim wheel 11614481 Mar 28 05:11 phone.pnm
-rw-r--r-- 1 jim wheel 2903632 Mar 28 05:18 phone-2.pam
-rw-r--r-- 1 jim wheel 725919 Mar 28 05:19 phone-4.pam
-rw-r--r-- 1 jim wheel 115785 Mar 28 05:19 phone-10.pam
-rw-r--r-- 1 jim wheel 464457 Mar 28 05:20 phone-5.pam
-rw-r--r-- 1 jim wheel 31872 Mar 28 05:21 phone-4.jpeg


Display preview locally:
bash-3.2$ xli phone-4.jpeg
phone-4.jpeg is a 568x426 JPEG image, color space YCbCr, 3 comps., Huffman coding
Building XImage...done


Notes to self on how I hooked the camera USB cable to the NetBSD PC:
bash-3.2$ cat camer.a
Mar 27 16:51:32 stinky ntpd[1071]: kernel time sync status change 2001
Mar 27 18:32:57 stinky /netbsd: umass1 at uhub2 port 1 configuration 1 interface 0
Mar 27 18:32:57 stinky /netbsd:
Mar 27 18:32:57 stinky /netbsd: umass1: NIKON NIKON DSC COOLPIX L4, rev 1.10/0.00, addr 3
Mar 27 18:32:57 stinky /netbsd: umass1: using ATAPI over Bulk-Only
Mar 27 18:32:57 stinky /netbsd: atapibus1 at umass1: 2 targets
Mar 27 18:32:57 stinky /netbsd: sd4 at atapibus1 drive 0: disk removable
Mar 27 18:32:57 stinky /netbsd: sd4: fabricating a geometry
Mar 27 18:32:57 stinky /netbsd: sd4: 489 MB, 489 cyl, 64 head, 32 sec, 512 bytes/sect x 1002496 sectors
Mar 27 18:33:19 stinky /netbsd: sd4: fabricating a geometry

A fake drive appears:
bash-3.2# less messages
bash-3.2# disklabel sd4
# /dev/rsd4d:
type: ATAPI
disk: DSC COOLPIX L4
label: fictitious
flags: removable
bytes/sector: 512
sectors/track: 32
tracks/cylinder: 64
sectors/cylinder: 2048
cylinders: 489
total sectors: 1002496
rpm: 3600
interleave: 1
trackskew: 0
cylinderskew: 0
headswitch: 0 # microseconds
track-to-track seek: 0 # microseconds
drivedata: 0

5 partitions:
# size offset fstype [fsize bsize cpg/sgs]
d: 1002496 0 unused 0 0 # (Cyl. 0 - 489*)
e: 1002263 233 MSDOS # (Cyl. 0*- 489*)
disklabel: boot block size 0
disklabel: super block size 0


Connect it up (preview earlier)
bash-3.2# mount -tmsdos -r /dev/sd4e /usb

Copy and demo:
bash-3.2# cp -p /usb/DCIM/110NIKON/DSCN254* .
bash-3.2# file DSCN2552.JPG
DSCN2552.JPG: JPEG image data, EXIF standard
bash-3.2# xli DSCN2552.JPG
DSCN2552.JPG is a 2272x1704 JPEG image, color space YCbCr, 3 comps., Huffman coding
Building XImage...done


Done with drive - save energy:
bash-3.2# umount /usb

Transform:
bash-3.2$ jpegtopnm phone.pnm
bash-3.2$ pnmscale -reduce 4 phone.pnm >phone-4.pam
bash-3.2$ ppmtojpeg phone-4.pam >phone-4.jpeg

Check sizes:
bash-3.2$ xli -ident DSCN2552.JPG
DSCN2552.JPG is a 2272x1704 JPEG image, color space YCbCr, 3 comps., Huffman coding
bash-3.2$ xli -ident phone-4.pam
phone-4.pam is a 568x426 Raw PPM image with 256 levels
bash-3.2$ xli -ident phone-4.jpeg
phone-4.jpeg is a 568x426 JPEG image, color space YCbCr, 3 comps., Huffman coding



I had tried pamscale but it faulted. The pnmscale worked.

All this, to get a camera shot of the new phone working. I thought about going to a room with parallel mirrors, but others might not get it.

With the post earlier today as a snurl, I got this compliment from Al - @folknology:

@jspath55 dam your more geek than I am!!

"Nice!"

No comments: