Re: your mail

becka@rz.uni-duesseldorf.de
Tue, 20 Oct 1998 22:02:03 +0200 (MEST)

Hi !

> i just purchased a Casio QV-11 camera the other day and got

> load CAM pictures directly into the GIMP). Now i think i read in the
> SANE doc that JPEG was not supported yet... i don't see the point of
> translating a JPEG file into a bitmap that SANE can handle, since most
> often users might convert the result to JPEG in the end anyway..

Yes. If it hasn't been removed, there was an entry in the "TODO" file
or something that stated that for a while.
Oh - just found it again in "LEVEL2".

BTW: David - could you correct my EMail address in there ?
The one stated there isn't valid on the internet, just within my intranet.
becka@ggi-project.org is.

> So here are basically the questions:
> - how hard is it to write a backend? what's a good place to
> start (which one is the simplest ?) ?

I once wrote the pnm backend to serve as some kind of reference
implementation. In your case, this might be a good place to start, as
effectively the camera is more like an "external image library" than like
a scanner, so it does make sense to start from the pnm backend.

I'd say it isn't too hard, if you have the actual communications code.
The SANE interface itself is pretty simple, once you have grasped how
this option stuff works.

> - when will there be JPEG support in the SANE interface? i guess
> other camera (such as the Kodak ones?) also use a format
> that's close to JPEG...

We should finally add that.

My idea about adding it would be to increase the version number, which
can be queried at sane_init() time.

If the frontend finds a sufficiently high version, it would assume
that the SANE_Parameters struct is extended by a few fields like:

SANE_String mime_type;
SANE_String suggested_filename;

This would effectively take care of all possible fileformats.

The frontend code would have to be changed a bit like this:

if (strcmp(param.mimetype,"application/SANE"))
save_directly_to_file(
make_path_suitable_for_host_os(
param.suggested_filename)));
else
do_the_same_as_before();

This would also take care of the second suggestion in the file to use SANE
for arbitrary datatypes.

File size could be handled in a compatible way, by setting bytes_per_line
and lines accordingly, that is usually to something like fsize(),1 or
1,fsize().

This would only be a minor modification to frontends and backends
(even old frontends would handle new-style data somewhat correctly,
if they would save it to a file directly without trying to convert/
interpret it first). Most of our current front-ends afaik do a very
simplistic "convert to pnm" which could easily be undone afterwards
by a small script that simply removes the header.

CU, Andy

-- 
= Andreas Beck                    |  Email :  <andreas.beck@ggi-project.org> =

--
Source code, list archive, and docs: http://www.mostang.com/sane/
To unsubscribe: echo unsubscribe sane-devel | mail majordomo@mostang.com