<div dir="ltr"><div>Thank you for the input.</div><div><br></div>I'm redoing phpsane. I'll look at the others but I came up with a method that seems to work a little better then I have seen so far. Like I mentioned I'm using proc_open in a process that I put in the background and to allow me to watch the image as it is being pulled. I am pulling the selection interface I saw on phpsane. I talked to the developer of phpsane and he suggested I rebuild it. I can successfully pull scanner specific options and create a custom option list for them. I'll add the option to stop and try it out. But I will caution other users on that. I will cache options and scanner returns to speed things up.<div><br></div><div>I was even successful at allowing an array input in html :-)</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Sep 30, 2017 at 3:16 PM, Jeff <span dir="ltr"><<a href="mailto:jffry@posteo.net" target="_blank">jffry@posteo.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 29/09/17 15:52, Jeff Sadowski wrote:<br>
> I am developing a php interface I'm calling it php saneng I have it on<br>
> bitbucket for now and using proc_open. I will send the signal via<br>
<br>
</span>You are not the first. Have you looked at<br>
<a href="https://sourceforge.net/projects/phpsane/" rel="noreferrer" target="_blank">https://sourceforge.net/<wbr>projects/phpsane/</a> or<br>
<a href="https://github.com/anomen-s/php-sane" rel="noreferrer" target="_blank">https://github.com/anomen-s/<wbr>php-sane</a> or <a href="https://github.com/sbs20/scanserv" rel="noreferrer" target="_blank">https://github.com/sbs20/<wbr>scanserv</a> ?<br>
<br>
I should probably point a few things before you continue down the dark<br>
path of making a wrapper around scanimage.<br>
<br>
When I started writing gscan2pdf back in 2006, it was exactly that, a<br>
Gtk2 wrapper around scanimage, written in Perl.<br>
<br>
It seemed like a good idea to wrap scanimage at the time, but it quickly<br>
became clear that the problem is that you have no way of handling option<br>
reloads. You can make it work for one scanner easily enough, but in a<br>
general sense, it is impossible.<br>
<br>
You are completely at the whim of the backend if an option, e.g. source<br>
or depth, option force a reload. And they do, which changes unexpected<br>
things. For instance some scanners support one page size (i.e. scan<br>
size) for flatbed, and another for ADF.<br>
<br>
You can work around this by calling scanimage [extra options] --help<br>
every time the user changes an option, but this will be slow. You can<br>
make it quicker by caching the options, but this is error-prone.<br>
<br>
You will find that because of this, the order in which the options are<br>
set is vitally important. i.e. for the above example, you have to set<br>
the source option before the geometry options, as the range of geometry<br>
options is changed by source. And confusingly, some backends have<br>
different names for the same options.<br>
<br>
In the end, I wrote Perl bindings for the SANE API. This solved all of<br>
the above problems, as you then get reload callbacks:<br>
<br>
<a href="http://search.cpan.org/~ratcliffe/Image-Sane-0.14/" rel="noreferrer" target="_blank">http://search.cpan.org/~<wbr>ratcliffe/Image-Sane-0.14/</a><br>
<br>
However, it is non-trivial. Here is a tutorial on writing PHP extensions<br>
in C:<br>
<br>
<a href="http://web.archive.org/web/20110222035803/http://devzone.zend.com/article/1021" rel="noreferrer" target="_blank">http://web.archive.org/web/<wbr>20110222035803/http://devzone.<wbr>zend.com/article/1021</a><br>
<br>
Good luck.<br>
<br>
Regards<br>
<span class="HOEnZb"><font color="#888888"><br>
Jeff<br>
<br>
</font></span><br>--<br>
sane-devel mailing list: <a href="mailto:sane-devel@lists.alioth.debian.org">sane-devel@lists.alioth.<wbr>debian.org</a><br>
<a href="http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel" rel="noreferrer" target="_blank">http://lists.alioth.debian.<wbr>org/cgi-bin/mailman/listinfo/<wbr>sane-devel</a><br>
Unsubscribe: Send mail with subject "unsubscribe your_password"<br>
to <a href="mailto:sane-devel-request@lists.alioth.debian.org">sane-devel-request@lists.<wbr>alioth.debian.org</a><br></blockquote></div><br></div>