maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   Camera/Sketch/Email app idea? (https://talk.maemo.org/showthread.php?t=17554)

omq 2008-03-05 15:08

Camera/Sketch/Email app idea?
 
I had the N800 out on a job site the other day, and it occurred to me that the low-quality N800 camera could be made useful, if there was an application that bundled together the following functions:

1. Take a picture (Camera)
2. Sketch or input text on picture directly (Maemopad+ like)
3. Email picture out

I'm not a developer, but it seems the elements are all there for a usable app - is there already such an application? Thanks for listening.

ClarenceGWhite 2008-03-05 15:22

Re: Camera/Sketch/Email app idea?
 
Excellent idea! That would add a lot of functionality to the device. I hope someone can do this.

xtagon 2008-03-13 00:32

Re: Camera/Sketch/Email app idea?
 
I can see the headlines now... "lolcatz photo rate goes up 10% due to new IT app..."

Nah, I like the idea : )
I only wish I could help develop it

gammer 2008-03-13 11:27

Re: Camera/Sketch/Email app idea?
 
As far as I remember Xournal allows custom background pictures for sketches. Plus it can export to pdf.

Munk 2008-03-13 17:26

Re: Camera/Sketch/Email app idea?
 
Nice idea!

Since we're dreaming it up can I add;
1) gps aware, stamp the lon/lat info
2) time stamp on the pic like some cameras do
3) voice note possibility
4) rudimentary brightness/control
5) of course history of all previous pics and email log
6) maybe direct upload to flickr or blog, etc

sorry, going on and on because it's an awesome idea omq

xtagon 2008-03-13 20:26

Re: Camera/Sketch/Email app idea?
 
So what you're suggesting is that the app would work something like this, right?:

1) Snap a picture
2) Do some simple editing if desired (brightness/contrast, flip/rotate)
3) Type or sketch optional captions or notes
4) Save and/or send to one or more contacts

As far as stamping GPS info and timestamps, maybe it would make more sense to have it add those textually underneath the sent photo. (I'm assuming we want it to send it by email)

Benson 2008-03-13 20:32

Re: Camera/Sketch/Email app idea?
 
They should be in the EXIF tags, at any rate; then the recipient can get them, so I'm not sure what the point is of either printing or emailing them. Never hurts to have options, though.

omq 2008-03-26 13:57

Re: Camera/Sketch/Email app idea?
 
There's a similar app called Sketches on the iphone - love the shake to erase idea.

dan 2008-04-02 09:03

Re: Camera/Sketch/Email app idea?
 
I'm for your idea omq.
Gammer many thanks for xjournal tip. I've been using xjournal to write notes and so forth. Now I have a whole new way to use xjournal! Dan

GeraldKo 2008-04-02 16:26

Re: Camera/Sketch/Email app idea?
 
Quote:

Originally Posted by gammer (Post 154361)
As far as I remember Xournal allows custom background pictures for sketches. Plus it can export to pdf.

So omq can already do everything he's talking about, right? It just takes using a few programs together (shoot the photo with Camera, edit it with Quiver if he needs to, bring the saved photo into Xournal, and attach it to an email with an already-existing email client).

Benson 2008-04-02 16:35

Re: Camera/Sketch/Email app idea?
 
Well, I whacked up a script to convert an image to pdf and launch xournal; then you edit it and save as a pdf, then it converts it back. It's too dumb and simple and useless to post yet, if you have imagemagick and xournal, you know how to do it already,

Things missing:
Camera photo grabbage: Anyone know how to do this from a script? No? Hmmm.....
Mailing: Probably requires DBUS work, should be workable, I just don't know how.

Things you may not like:
Uses ImageMagick (that requires like 30 MB to install)
You have to export as pdf with a specific name, which it does not have as a default value.

I've got a plan on how to rectify both of those... it should be out later in the week.
I've no clue on the photo-taking or emailing end, beyond what I wrote. Any advice is appreciated.

RogerS 2008-04-02 16:53

Re: Camera/Sketch/Email app idea?
 
Quote:

Originally Posted by Benson (Post 163978)
Well, I whacked up a script to convert an image to pdf and launch xournal; then you edit it and save as a pdf, then it converts it back. It's too dumb and simple and useless to post yet, if you have imagemagick and xournal, you know how to do it already,
...
I've no clue on the photo-taking or emailing end, beyond what I wrote. Any advice is appreciated.

This sounds like more than a little start. I say, Worry about the emailing later.

And on the N810, you're going to have to stop and look at the picture you took before you decide you got what you intended (unlike the N800, where you should be able to see that you at least framed the subject properly). So implementing this as a second step in a process instead of an everything-in-one-package-starting-from-the-camera-click might be better anyway.

Post soon!

Benson 2008-04-02 17:56

Re: Camera/Sketch/Email app idea?
 
Quote:

Originally Posted by RogerS (Post 163991)
This sounds like more than a little start. I say, Worry about the emailing later.

And on the N810, you're going to have to stop and look at the picture you took before you decide you got what you intended (unlike the N800, where you should be able to see that you at least framed the subject properly). So implementing this as a second step in a process instead of an everything-in-one-package-starting-from-the-camera-click might be better anyway.

Post soon!

Well, I was figuring on aim-n-pray anyhow; I assumed whatever scriptable tool probably won't have video preview. But I suppose you could use whatever camera tool, then have the script grab (by default) the last image taken...

E-mail is probably easy for someone, so I was gonna post without and let them patch it. ;)

What's tying me up right now is { pdf | ppm } -> jpeg conversion (other than ImageMagick; I'm trying to eliminate that dependency). Also, it'd be nice to get rotation by 90 degrees; we can check if xrandr is present, and if so, rotate according to screen alignment. But that won't hold up an initial release.

If I can't get that in a couple days at worst, I'll release a script that saves as .pdf only.

ps My apologies for the flurry of posting and unposting. Microb was on crack.

anders_gud 2008-04-02 18:09

Re: Camera/Sketch/Email app idea?
 
Quote:

Originally Posted by Benson (Post 164046)
Well, I was figuring on aim-n-pray anyhow; I assumed whatever scriptable tool probably won't have video preview.

Maybe the Easy python API is something to look into for this kind of project? Looks promising...

Benson 2008-04-02 18:13

Re: Camera/Sketch/Email app idea?
 
Thanks, but I don't python. Well, maybe if I have to I could kludge something together from examples, but I could probably get a C program to do it easier.

Benson 2008-04-03 02:04

Re: Camera/Sketch/Email app idea?
 
1 Attachment(s)
On the other hand, I guess easy does make it easy. I still don't know or want to learn python, but the camera snapshot example looks simple, and with a little down-stripping, useful for this. Maybe I'll give that a shot later... or someone else can, if they get impatient.

But here's a script:
Code:

#!/bin/sh
jpegtopnm -exif=/home/user/tmp.cheezburgr.exif $1 >/home/user/tmp.cheezburgr.ppm

echo '<?xml version="1.0" standalone="no"?>' >/home/user/tmp.cheezburgr.xoj
echo '<xournal version="0.4.1">' >>/home/user/tmp.cheezburgr.xoj
echo '<title>Xournal document - see http://math.mit.edu/~auroux/software/xournal/</title>' >>/home/user/tmp.cheezburgr.xoj
echo '<page width="'`pamfile /home/user/tmp.cheezburgr.ppm |cut -f2 |cut -f3 -d' '`'" height="'`pamfile /home/user/tmp.cheezburgr.ppm |cut -f2 |cut -f5 -d' '`'">' >>/home/user/tmp.cheezburgr.xoj
echo '<background type="pixmap" domain="absolute" filename="/home/user/tmp.cheezburgr.ppm" />' >>/home/user/tmp.cheezburgr.xoj
echo '<layer>' >>/home/user/tmp.cheezburgr.xoj
echo '</layer>' >>/home/user/tmp.cheezburgr.xoj
echo '</page>' >>/home/user/tmp.cheezburgr.xoj
echo '</xournal>' >>/home/user/tmp.cheezburgr.xoj

xournal /home/user/tmp.cheezburgr.xoj
if [ ! -e /home/user/MyDocs/tmp.cheezburgr.pdf ] ; then
  rm /home/user/tmp.cheezburgr*
  exit
fi
rm /home/user/tmp.cheezburgr.ppm
pdftoppm -f 1 -l 1 -r 72 /home/user/MyDocs/tmp.cheezburgr.pdf /home/user/tmp.cheezburgr
rm /home/user/MyDocs/tmp.cheezburgr.pdf
pnmtojpeg -exif=/home/user/tmp.cheezburgr.exif /home/user/tmp.cheezburgr-*.ppm >$1_edited.jpg
rm /home/user/tmp.cheezburgr*

Now the dependencies:
  • Xournal (from repos, check http://www.gronmayer.com/it/)
  • netpbm (Maemo build not available, as far as I can tell)
  • libnetpbm10 (Maemo build not available, as far as I can tell)
I'm using netpbm (&c.) from Debian Lenny:
http://packages.debian.org/lenny/armel/netpbm/download
http://packages.debian.org/lenny/arm...pbm10/download
But the dependencies aren't new enough! :eek:
Seemed to work fine with: (as root, of course)
Code:

dpkg -i --force-depends-version netpbm_10.0-11.1_armel.deb libnetpbm10_10.0-11.1_armel.deb
No guarantees, of course, but it seems to work fine. And much smaller than imagemagick.

Oh, and in case you don't notice, no handling of rotation yet. But it should be pretty easy.

muki 2008-04-03 12:17

Re: Camera/Sketch/Email app idea?
 
lol, I like the example image :-)))

Benson 2008-04-04 01:44

Re: Camera/Sketch/Email app idea?
 
OK, just realized I left the instructions out of the previous post, as I sat down to post this one... But here's a new version that uses the camera via easy. I warn, it's not really anywhere close to finished; but it works, so try it.

Instructions:
Installation:
Dependencies:
  • easy
  • Xournal (from repos, check http://www.gronmayer.com/it/)
  • netpbm (Maemo build not available, as far as I can tell)
  • libnetpbm10 (Maemo build not available, as far as I can tell)
I'm using netpbm (&c.) from Debian Lenny:
http://packages.debian.org/lenny/armel/netpbm/download
http://packages.debian.org/lenny/arm...pbm10/download
But the dependencies aren't new enough! :eek:
Seemed to work fine with: (as root, of course)
Code:

dpkg -i --force-depends-version netpbm_10.0-11.1_armel.deb libnetpbm10_10.0-11.1_armel.deb
No guarantees, of course, but it seems to work fine. And much smaller than imagemagick.
Installation proper:
Place cheezburgr_snap.py in /home/user/apps. Or, if you put it elsewhere, edit cheezburgr.sh.
Place cheezburgr.sh somewhere executable, such as /home/user/apps.
Make both files executable

Running:
Capturing new image:
Code:

cheezburgr.sh
Yep, put that one in cmd-navigator, personal menu, osso-statusbar-cpu, or powerlaunch.
Or run it from an xterm, see if I care.

The screen will come up with a squashed video preview, a resolution selector, and a click button. Clicky-click click, and it takes a picture, and exits that window, and seems to be doing nothing while it converts the image and launches xournal. Xournal comes up, you make your changes as you see fit, and then you have to choose export as pdf, and click OK without changing the filename. Close xournal now (no point saving), and your image arrives in MyDocs/.images/.
From existing image:
Code:

cheezburgr.sh image.jpg
Yes, it's jpeg only right now; that can be fixed easily, but isn't done yet. Otherwise, it's similar to the latter portions snapshot mode.

Todo
  • Rotation detection
    Yes it's easy, no it's not done yet. This will also take care of camera flipover on the N800...
  • E-mail
    Obviously, we need to go through dbus for this; I don't really know what I'm doing there, so count me out. (If I had to do it, I'd probably make pine a dependency :p)
  • Chance to preview (& discard) multiple shots before submitting one to Xournal
    Sorry N810 users; buy a hand-mirror, or find someone who doesn't despise python to fix things up.
  • Aspect ratio of preview
    Sorry, everyone; ditto.
  • Full-screen for capture tool?
    ditto, but a curved hand-mirror.
  • Make saving from Xournal less complex
    Hmmmm.... Not happening?
    Sorry, I know this isn't user friendly, but I can't see the requisite changes to Xournal happening. Maybe some other app is more suitable, but xournal's all I know that's good for both text and scrawling.

qwerty12 2009-01-14 19:11

Re: Camera/Sketch/Email app idea?
 
Quote:

Originally Posted by Benson (Post 164803)
E-mail
Obviously, we need to go through dbus for this; I don't really know what I'm doing there, so count me out. (If I had to do it, I'd probably make pine a dependency :p)

dbus-send --print-reply --type=method_call --dest=com.nokia.modest /com/nokia/modest com.nokia.modest.MailTo string:mailto:mail@me.!

(dbus-monitor isn't hard to use but I see this post is old so I wouldn't be surprised if you have already added dbus know-how to your very wide unix knowledge ;))

Ah, that just opens a new mail window, not add an attachment. Sorry.

qole 2009-01-14 20:12

Re: Camera/Sketch/Email app idea?
 
Quote:

Originally Posted by Benson (Post 163978)
Camera photo grabbage: Anyone know how to do this from a script? No? Hmmm....

You can use gst-launch from a shell script to capture images from the camera.

I have an example videocam line in this post, but a few tweaks would take a jpg picture instead. This also automatically handles rotation-detection.

EDIT: Where are your scripts (cheezburgr.sh and cheezburgr_snap.py), Benson? I can't seem to find them in your posts anywhere.

Benson 2009-01-14 20:29

Re: Camera/Sketch/Email app idea?
 
The initial cheezburgr.sh was this:
Quote:

Originally Posted by Benson (Post 164304)
But here's a script:
Code:

#!/bin/sh
jpegtopnm -exif=/home/user/tmp.cheezburgr.exif $1 >/home/user/tmp.cheezburgr.ppm

echo '<?xml version="1.0" standalone="no"?>' >/home/user/tmp.cheezburgr.xoj
echo '<xournal version="0.4.1">' >>/home/user/tmp.cheezburgr.xoj
echo '<title>Xournal document - see http://math.mit.edu/~auroux/software/xournal/</title>' >>/home/user/tmp.cheezburgr.xoj
echo '<page width="'`pamfile /home/user/tmp.cheezburgr.ppm |cut -f2 |cut -f3 -d' '`'" height="'`pamfile /home/user/tmp.cheezburgr.ppm |cut -f2 |cut -f5 -d' '`'">' >>/home/user/tmp.cheezburgr.xoj
echo '<background type="pixmap" domain="absolute" filename="/home/user/tmp.cheezburgr.ppm" />' >>/home/user/tmp.cheezburgr.xoj
echo '<layer>' >>/home/user/tmp.cheezburgr.xoj
echo '</layer>' >>/home/user/tmp.cheezburgr.xoj
echo '</page>' >>/home/user/tmp.cheezburgr.xoj
echo '</xournal>' >>/home/user/tmp.cheezburgr.xoj

xournal /home/user/tmp.cheezburgr.xoj
if [ ! -e /home/user/MyDocs/tmp.cheezburgr.pdf ] ; then
  rm /home/user/tmp.cheezburgr*
  exit
fi
rm /home/user/tmp.cheezburgr.ppm
pdftoppm -f 1 -l 1 -r 72 /home/user/MyDocs/tmp.cheezburgr.pdf /home/user/tmp.cheezburgr
rm /home/user/MyDocs/tmp.cheezburgr.pdf
pnmtojpeg -exif=/home/user/tmp.cheezburgr.exif /home/user/tmp.cheezburgr-*.ppm >$1_edited.jpg
rm /home/user/tmp.cheezburgr*


As for the newer version (slightly modified, only pertaining to the image acquistion), and the python, that puzzles me. I think I tarred them and attached? But they're certainly not there. :confused: Oh well, 'twas ages ago; maybe I simply botched.

I'll look for them to repost, and probably recreate this (with gst-launch, maybe) if I don't find them. Although I hope nobody seriously wants it...


All times are GMT. The time now is 04:10.

vBulletin® Version 3.8.8