G’day All,

We are talking Mac ONLY - High Sierra and Catalina!

I found a command line application that can take a snapshot with the current 
camera.

This nifty tool is called “imagesnap” and it is totally free in all regards.

Check out: http://iharder.sourceforge.net/current/macosx/imagesnap/ 
<http://iharder.sourceforge.net/current/macosx/imagesnap/>

So, I placed that tool in the resource folder of the application I’m working on 
and tried to call it from within 4D via LEP:

<4D code>

C_TEXT($cmd)
C_TEXT($FoDoPath;$OutPictPath;$imageSnapPath)
C_BLOB($StdIn;$StdOut;$Error)
C_LONGINT($PID)

$FoDoPath:=Get 4D folder(Current resources folder)
$FoDoPath:=Convert path system to POSIX($FoDoPath)

$cmd:=$FoDoPath+"./imagesnap -w 2.0 "

LAUNCH EXTERNAL PROCESS($cmd;$StdIn;$StdOut;$StdOut;$PID)

</4D code>

Result: The camera shows activity, but no picture is saved nowhere.

And now comes the voodoo I don’t get:

I copied the content from “$cmd” out of the 4D-debugger and paste it into the 
terminal and got a jpg-picture saved into the current user account (it seems 
“imagesnap" has some problems with user specified destinations).

The “$cmd” in my case contains this: 
/DATA/4Dƒ/TTTCorev18/TTTCorev18.4dbase/Resources/./imagesnap -w 2.0 

Please tell me we can blame 4D for another botched implementation.

Any help, pointers etc. are appreciated.

Cheers
Jörg
**********************************************************************
4D Internet Users Group (4D iNUG)
New Forum: https://discuss.4D.com
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[email protected]
**********************************************************************

Reply via email to