List Info

Thread: JNI code for SANE




JNI code for SANE
user name
2006-01-24 13:22:17
Hello SANE developers,

I have written a simple JNI interface to SANE. ; It works pretty well and lets me do scans, display them, etc, all within Java. ; I am interested in possibly getting this included in the SANE project under the same license as SANE itself.  Would the devs be open to this? ; It's pretty basic code right now, but my vision is that it would be possible to use it with gcj to make compiled scanner apps for Linux in Java, so we could have things similar to Kooka, but in Java. ; In fact with the Java Qt bindings we could have quite a good environment for making scanning apps.

Would the SANE project be interested in this?



What are the most popular cars? Find out at Yahoo! Autos
JNI code for SANE
user name
2006-01-25 16:01:51
Any URL to take a look at it?

Jens

Vacuum Joe schrieb:
> Hello SANE developers,
>  
>  I have written a simple JNI interface to SANE.  It
works pretty well and lets me do scans, display them, etc,
all within Java.  I am interested in possibly getting this
included in the SANE project under the same license as SANE
itself.  Would the devs be open to this?  It's pretty basic
code right now, but my vision is that it would be possible
to use it with gcj to make compiled scanner apps for Linux
in Java, so we could have things similar to Kooka, but in
Java.  In fact with the Java Qt bindings we could have quite
a good environment for making scanning apps.
>  
>  Would the SANE project be interested in this?

-- 
sane-devel mailing list: sane-devellists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/sane-d
evel
Unsubscribe: Send mail with subject "unsubscribe
your_password"
             to sane-devel-requestlists.alioth.debian.org
JNI code for SANE
user name
2006-01-25 16:36:17
Not right now.  I don't really want to host the code myself, which is part of why I want to hand this over to the SANE project.  I could send you a tarball if you want. ; Ideally the SANE project would host SVN for it, too, right?  This would all be GPL.

It seems like this is an idea and need that has come up in the past:

http://lists.alioth.debian.org/pipermail/sane-devel/2003-November/009223.html

I hope if we could get some code officially into the SANE project this will start being adopted.  Java is a great environment for doing graphics and scanning type applications.

Jens Gulden <mailjensgulden.de> wrote:
Any URL to take a look at it?

Jens

Vacuum Joe schrieb:
&gt; Hello SANE developers,
>
> I have written a simple JNI interface to SANE. It works pretty well and lets me do scans, display them, etc, all within Java. I am interested in possibly getting this included in the SANE project under the same license as SANE itself. Would the devs be open to this? It's pretty basic code right now, but my vision is that it would be possible to use it with gcj to make compiled scanner apps for Linux in Java, so we could have things similar to Kooka, but in Java. In fact with the Java Qt bindings we could have quite a good environment for making scanning apps.
>
> Would the SANE project be interested in this?

--
sane-devel mailing list: sane-devellists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
to sane-devel-requestlists.alioth.debian.org


Do you Yahoo!?
With a free 1 GB, there's more in store with Yahoo! Mail.
JNI code for SANE
user name
2006-01-26 18:04:33
Hi,

On 2006-01-24 05:22, Vacuum Joe wrote:
>  I have written a simple JNI interface to SANE.  It
works pretty well
>  and lets me do scans, display them, etc, all within
Java.  I am
>  interested in possibly getting this included in the
SANE project
>  under the same license as SANE itself.  Would the devs
be open to
>  this? 

Could you explain for java-impaired people like me what jni
is, how it
is connected to java and how your project is different to
the other
java projects? There is already code that comes with SANE
(sane-backends/japi), there is jsane (commercial,
http://asp
rise.com/product/jsane/index.php) and morena
(http://www.gnome.s
k/Twain/jtp.html).

There are some possibilities to include such a project into
SANE: 

1) Place it in sane-backends. There you have CVS and it
would come
   with every sane-backends installation. However this only
makes
   sense if it is widely used and maintained. For this
reason I
   already thought about removing japi from sane-backends
beacuse its
   unmaintained and doesn't seem to be used.

2) Put it somewhere in the experimental CVS. There is CVS
access in
   this case but uses need to install CVS to get the
software.

3) Put it on the FTP server (and obviously a link somewhere
on the web
   site). No CVS in this case.

Until now I only mention Debian's and redhat's contributions
explicitely, but explicitely mentionning the company/person
who wrote
the code isn't a problem.

Including into SANE really needs a maintainer, however. So
either you
must manintain it also in future or we must wait for
somebody else who
volunteers to do so.

Your other mails don't seem to contain any links, maybe this
is
because I use a non-graphical mail program?

Bye,
  Henning

-- 
sane-devel mailing list: sane-devellists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/sane-d
evel
Unsubscribe: Send mail with subject "unsubscribe
your_password"
             to sane-devel-requestlists.alioth.debian.org
JNI code for SANE
user name
2006-01-26 18:39:10

Could you explain for java-impaired people like me what jni is, how it
is connected to java and how your project is different to the other
java projects? There is already code that comes with SANE
(sane-backends/japi), there is jsane (commercial,
http://asprise.com/product/jsane/index.php) and morena
(http://www.gnome.sk/Twain/jtp.html).

JNI = Java Native Interface.  Quick summary: Everything within Java runs in a virtual machine.&nbsp; No Java program has access to memory, and it also cannot call libraries or do any real machine-level stuff.&nbsp; This is why Java is so stable and secure: programs can't stomp on memory or do anything else that is not allowed by the JVM and the JVM's security policies.&nbsp; The only way Java can interact with the real hardware is through the interfaces provided by the Java Virtual Machine (JVM).&nbsp; In some cases, this is too confining, like if you need to interface to a library.&nbsp; The SANE library is just such a library.&nbsp; In this case, the Java Native Interface can be used. ; It allows you to write code in C (or C++, etc) and have the JVM dynamically link the library in, and then the Java code can call out to the library.&nbsp; What I have done is use JNI to wrap the SANE library so I can access SANE from within Java.

This is very similar to Morena.&nbsp; I think it is similar to jsane, except jsane only works with network scanners (I may be wrong on that).&nbsp; The difference is that we can release this under GPL because we don't anticipate trying to sell this code as its own product.

As for japi in the SANE backends, yes, this is very similar to that, except that code is about 9 years old and doesn't seem to be maintained.  Java has changed a lot in 9 years.&nbsp; Unless there is some reason not t o, it makes sense to remove japi from sane-backends.

There are some possibilities to include such a project into SANE:

1) Place it in sane-backends. There you have CVS and it would come
with every sane-backends installation. However this only makes
sense if it is widely used and maintained. For this reason I
already thought about removing japi from sane-backends beacuse its
unmaintained and doesn't seem to be used.

It really belongs in the front-ends I believe.&nbsp; There seem to be requests and commercial products that do the same thing, so I think there is interest.&nbsp; Obviously japi is no longer maintained and is not really set up for modern Java use.  For example japi can't do something simple like scan and save as a JPEG. ; My code can.  Also my company will sponsor maintenance of the code, with the hope that SANE will just put a simple small link to the company site.

There are some good advantages for this. ; In the future, we could have an alternative to xscanimage that is written in Java. ; This would have have advantages in terms of stability, ease of use, and ability to easily integrate into other Java apps. ; Java is starting to make an entrance into the Linux desktop world.&nbsp; As you may know, gcc now has a powerful and capable Java compiler, called gcj, so it is now possible to compile Java applications into native binaries and run them just like any other program, without needing a JVM at all.  Also Trolltech is releasing an official Qt binding for Java, so we could have a full Qt/KDE scanner application in Java using this code. ; Java is becoming a bigger part of the Linux desktop.

Until now I only mention Debian's and redhat's contributions
explicitely, but explicitely mentionning the company/person who wrote
the code isn't a problem.
Ah, that is good. ; Actually we ideally would like a HTML link. ; They will sponsor maintenance and answer questions on it.
Including into SANE really needs a maintainer, however. So either you
must manintain it also in future or we must wait for somebody else who
volunteers to do so.

We'll do it.
Your other mails don't seem to contain any links, maybe this is
because I use a non-graphical mail program?

Yes.  I'm using this crazy Yahoo JavaScript mail client which seems more frustrating than helpful.&nbsp; Here's the URL: http://chiralsoftware.net/scanner/applet.html .  Hopefully that will get through.&nbsp; If not, it's chiralsoftware dot net slash scanner slash applet.html


Do you Yahoo!?
With a free 1 GB, there's more in store with Yahoo! Mail.
JNI code for SANE
user name
2006-01-29 21:51:32
Hi,

On 2006-01-26 10:39, Vacuum Joe wrote:
>  JNI = Java Native Interface.  Quick summary:
Everything within Java

[...]

Thanks for all your explanations.

>  It really belongs in the front-ends I believe.  There
seem to be
>  requests and commercial products that do the same
thing, so I think
>  there is interest.  Obviously japi is no longer
maintained and is
>  not really set up for modern Java use.  For example
japi can't do
>  something simple like scan and save as a JPEG.  My
code can.  Also
>  my company will sponsor maintenance of the code, with
the hope that
>  SANE will just put a simple small link to the company
site.

I guess you are right. Once all SANE code was in one
package, then
there was a split to -backends and -frontends but japi was
kept in
-backends.

So once the GPLed code has been found ok I think it can get
part of
sane-frontends.

Concerning japi I think we should pack it into a .tar.gz
file, put in
on the ftp server and link to it somewhere in case somebody
is still
interested. Then it can be removed from sane-backends CVS.

>  Ah, that is good.  Actually we ideally would like a
HTML link.  They
>  will sponsor maintenance and answer questions on it.

I'll just put it on the fronetnds page similar to the other
frontends
with a link to you and an explanation that the code is part
of
sane-frontends.

Bye,
  Henning

-- 
sane-devel mailing list: sane-devellists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/sane-d
evel
Unsubscribe: Send mail with subject "unsubscribe
your_password"
             to sane-devel-requestlists.alioth.debian.org
JNI code for SANE
user name
2006-01-29 22:23:07
> So once the GPLed code has been found ok I think it
> can get part of
> sane-frontends.

Excellent!
 
> Concerning japi I think we should pack it into a
> .tar.gz file, put in
> on the ftp server and link to it somewhere in case
> somebody is still
> interested. Then it can be removed from
> sane-backends CVS.

That sounds like the right thing.  I doubt there could
be any active projects still using it, but if there
are, they could get it.

> I'll just put it on the fronetnds page similar to
> the other frontends
> with a link to you and an explanation that the code
> is part of
> sane-frontends.

Excellent!  Thank you!

Now that I know that SANE is open to this, I need to
do a little bit of refactoring, etc, to get it ready
to go as an API.  Basically, the way it will work is
there will be a Scanner class which will use
providers.  Sane will be the provider for Linux
systems.  With the provider model, anyone who uses the
API won't have to worry about whether it is Sane (on
Linux) or TWAIN or whatever.  They will just use the
generic Scanner interface.  This is the same way most
things work in Java.  For example you write a database
application without making reference to any specific
database, so the same app will work on Oracle,
Postgres, etc.  This will allow people to start
writing more Scanner applications for Java.  Right now
there are not so many because it's so
platform-specific, and Java coders don't like
platform-specific stuff.

So I'll get that separated out and on our website
within a few days, and then you can review it and
hopefully put it on as an official part of SANE,
although maybe not in the sane-frontends.tar.gz per
se.  I'll probably also put in a very simple demo
application which makes a scan and saves a JPEG.

All the code that we submit will be under the GPL. 
>From a biz point of view, that's our only choice.

Now if only there were some better open source OCR
options.


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection
around 
http://mail.yahoo.com 

-- 
sane-devel mailing list: sane-devellists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/sane-d
evel
Unsubscribe: Send mail with subject "unsubscribe
your_password"
             to sane-devel-requestlists.alioth.debian.org
JNI code for SANE
user name
2006-01-31 20:40:58
Have you looked at JSane-net on sourcefoge ? (I'm the
maintainer, though not 
very well at the moment  )
It sounds like what you're planning is already part way
there in the project.
It was originally written to connect to sane via it's
network protocol, but I 
have extracted the interface, so that a JNI version could be
written.
I know that it has been used by a few people. Have alook and
tell me what you 
think. (sorry the main website is down at the moment.) do 
asearch on 
sourceforge for jsane-net

Andi

On Sunday 29 Jan 2006 22:23, Vacuum Joe wrote:
> > So once the GPLed code has been found ok I think
it
> > can get part of
> > sane-frontends.
>
> Excellent!
>
> > Concerning japi I think we should pack it into a
> > .tar.gz file, put in
> > on the ftp server and link to it somewhere in case
> > somebody is still
> > interested. Then it can be removed from
> > sane-backends CVS.
>
> That sounds like the right thing.  I doubt there could
> be any active projects still using it, but if there
> are, they could get it.
>
> > I'll just put it on the fronetnds page similar to
> > the other frontends
> > with a link to you and an explanation that the
code
> > is part of
> > sane-frontends.
>
> Excellent!  Thank you!
>
> Now that I know that SANE is open to this, I need to
> do a little bit of refactoring, etc, to get it ready
> to go as an API.  Basically, the way it will work is
> there will be a Scanner class which will use
> providers.  Sane will be the provider for Linux
> systems.  With the provider model, anyone who uses the
> API won't have to worry about whether it is Sane (on
> Linux) or TWAIN or whatever.  They will just use the
> generic Scanner interface.  This is the same way most
> things work in Java.  For example you write a database
> application without making reference to any specific
> database, so the same app will work on Oracle,
> Postgres, etc.  This will allow people to start
> writing more Scanner applications for Java.  Right now
> there are not so many because it's so
> platform-specific, and Java coders don't like
> platform-specific stuff.
>
> So I'll get that separated out and on our website
> within a few days, and then you can review it and
> hopefully put it on as an official part of SANE,
> although maybe not in the sane-frontends.tar.gz per
> se.  I'll probably also put in a very simple demo
> application which makes a scan and saves a JPEG.
>
> All the code that we submit will be under the GPL.
>
> >From a biz point of view, that's our only choice.
>
> Now if only there were some better open source OCR
> options.
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam
protection around
> http://mail.yahoo.com
-- 
sane-devel mailing list: sane-devellists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/sane-d
evel
Unsubscribe: Send mail with subject "unsubscribe
your_password"
             to sane-devel-requestlists.alioth.debian.org
[1-8]

about | contact  Other archives ( Real Estate discussion Medical topics )