how can I launching external programs?

Discussion of Common Lisp
ramarren
Posts: 613
Joined: Sun Jun 29, 2008 4:02 am
Location: Warsaw, Poland
Contact:

Re: how can I launching external programs?

Post by ramarren » Sat Nov 07, 2009 12:27 pm

Wolfgang Tsafack wrote:When try tu run this peace of code on Lispworks 5.0.1, I saw the shell fastly showing wiht a lot of thinks inside. But I didn't any image file on my computer.
Program convert shouldn't print anything in normal circumstances. Depending on how it was installed, you might need to specify full path to the program as well. Also, is the path separator on Windows not backslashes? In any case, the terminal output from the convert program is most likely describing the error.

gugamilare
Posts: 406
Joined: Sat Mar 07, 2009 6:17 pm
Location: Brazil
Contact:

Re: how can I launching external programs?

Post by gugamilare » Sat Nov 07, 2009 6:28 pm

sinnatagg wrote:
gugamilare wrote:Just to note, you are probably not allowed to sell or even distribute software compiled with Lispworks (someone correct me if I am wrong about "distribute"), though you can always distribute the source code and tell people to compile it themselves.
You're wrong. A Lispworks application or library built with the delivery runtime can be distributed with no additional runtime licensing.

http://www.lispworks.com/products/runtimes.html

Maybe you're thinking of Franz' Allegro CL ?

-a
In that page you cited:
[...]LispWorks Personal Edition does not include delivery.[...]
So, unless you pay for a license, you cannot "deliver". I am still not sure if there is another way of creating an executable which is allowed to be distributed, or if you can distribute compiled files.

Wolfgang Tsafack
Posts: 12
Joined: Thu Nov 05, 2009 11:09 am

Re: how can I launching external programs?

Post by Wolfgang Tsafack » Sun Nov 08, 2009 2:07 am

@Ramerren

Are you seen this post. Please help solve this problem:

____________________________________________________________
Re: how can I launching external programs?

Postby Wolfgang Tsafack » Sat Nov 07, 2009 12:18 pm
@Ramarren

When try tu run this peace of code on Lispworks 5.0.1, I saw the shell fastly showing wiht a lot of thinks inside. But I didn't any image file on my computer.
I search the file Belege-txt/20060629-10-14-56.jpg, but not one. Where did the file was stored? I don't have any idea.
That was what I want to do, have the image file stored in the same directory wiht the text file.
(sys:call-system "convert txt:D:/LispWorks/AA/Belege-txt/Belege-txt/20060629-10-14-56.txt
D:/LispWorks/AA/Belege-txt/Belege-txt/20060629-10-14-56.jpg")

ramarren
Posts: 613
Joined: Sun Jun 29, 2008 4:02 am
Location: Warsaw, Poland
Contact:

Re: how can I launching external programs?

Post by ramarren » Sun Nov 08, 2009 4:44 am

Wolfgang Tsafack wrote:@Ramerren

Are you seen this post. Please help solve this problem:
I already did.

Wolfgang Tsafack
Posts: 12
Joined: Thu Nov 05, 2009 11:09 am

Re: how can I launching external programs?

Post by Wolfgang Tsafack » Sun Nov 08, 2009 11:31 am

@Ramarren

I got it. I wokr!
But there is a problem: When converting a long file, ImageMagick make two image files.
For example I try to convert file123.txt, imageMagick make the 2 files file123-0.jpg and file123-1.jpg.
How can I make sure that, it convert the given file into only one file123.jpg

Thanks

Wolfgang Tsafack
Posts: 12
Joined: Thu Nov 05, 2009 11:09 am

Re: how can I launching external programs?

Post by Wolfgang Tsafack » Sun Nov 08, 2009 11:53 am

I enjoy to early.

whe work on command line editor for windows, i discover that it was not necessary to enter on the imageMagick directory to convert the file:
ImageMagick ist installed on my system at: C:\Program Files\ImageMagick-6.5.7-Q16. But I use my editor at: C:\User\Willy> an then I typed:
convert D:\Lispworks\AA\Belege-ocr\20060623-11-48.txt D:\Lispworks\AA\Belege-ocr\20060623-11-48.jpg I got the 2 files
20060623-11-48-0.jpg and 20060623-11-48-1.jpg created in the directory D:\Lispworks\AA\Belege-ocr\. that was in the DOS-console [the command line editor]

But when try to run the following code on Lispworks:

Code: Select all

(sys:call-system "convert D:\LispWorks\AA\Belege-ocr\20060623-11-48-23Kopie.txt
                  D:\LispWorks\AA\Belege-ocr\20060623-11-48-23Kopie.jpg")
. it didn't work. Why?
Therefore I tried to give the full path of the convert program wiht:

Code: Select all

(sys:call-system "C:\Program Files\ImageMagick-6.5.7-Q16\convert.exe D:\LispWorks\AA\Belege-ocr\20060623-11-48-23Kopie.txt
                  D:\LispWorks\AA\Belege-ocr\20060623-11-48-23Kopie.jpg")
. It didn't work too.
Then I tried to remove .exe on the programm path wiht:

Code: Select all

(sys:call-system "C:\Program Files\ImageMagick-6.5.7-Q16\convert.exe D:\LispWorks\AA\Belege-ocr\20060623-11-48-23Kopie.txt
                  D:\LispWorks\AA\Belege-ocr\20060623-11-48-23Kopie.jpg")
.It didn't work

Why does the code don't work? I don't have any idea ?
I will try on the imagemagick forum to get more information

ramarren
Posts: 613
Joined: Sun Jun 29, 2008 4:02 am
Location: Warsaw, Poland
Contact:

Re: how can I launching external programs?

Post by ramarren » Sun Nov 08, 2009 11:55 am

Wolfgang Tsafack wrote:How can I make sure that, it convert the given file into only one file123.jpg
As far as I can tell, it is not possible. At best, you can generate only the first page and discard the rest, see text operations Imagemagick usage examples. The other option would be to generate all the subimages, gather them from lisp with DIRECTORY and them combine them into one using the montage command.

Wolfgang Tsafack
Posts: 12
Joined: Thu Nov 05, 2009 11:09 am

Re: how can I launching external programs?

Post by Wolfgang Tsafack » Mon Nov 09, 2009 2:17 am

@Ramarren,
As far as I can tell, it is not possible. At...
I got it in only one image with adding the command line option append like this:

typing this

Code: Select all

convert D:/LispWorks/AA/Belege-ocr/20060623-11-48-23Kopie.txt [b]+append[/b] D:/LispWorks/AA/Belege-ocr/20060623-11-48-23Kopie.jpg
on the DOS comand line editor, i obtain only one file 20060623-11-48-23Kopie.jpg

Now why did the same don't work in a lisp code?

I wrote:

Code: Select all

(sys:call-system "convert D:/LispWorks/AA/Belege-ocr/20060623-11-48-23Kopie.txt +append D:/LispWorks/AA/Belege-ocr/20060623-11-48-23Kopie.jpg")
on lispworks. but it didn't work (the same work on Dos comand line editor!) what is the problem. What is the mistake a did??

@Anybody:

Can anybody take part in the topic? Please help me solve this problem. I fill it, i will get it soon. I just need a little thing i don't know.
Help please.

findinglisp
Posts: 447
Joined: Sat Jun 28, 2008 7:49 am
Location: Austin, TX
Contact:

Re: how can I launching external programs?

Post by findinglisp » Mon Nov 09, 2009 1:54 pm

I don't have an answer for you, but I'd simply note that at this point you're asking ImageMagick support questions, not Lisp support questions. You might be better served by finding an ImageMagick forum or resource and asking there.
Cheers, Dave
Slowly but surely the world is finding Lisp. http://www.findinglisp.com/blog/

nuntius
Posts: 538
Joined: Sat Aug 09, 2008 10:44 am
Location: Newton, MA

Re: how can I launching external programs?

Post by nuntius » Mon Nov 09, 2009 8:10 pm

I don't know the exact lispworks syntax; but I suspect your problem is that the program name ("convert") is not separate from the arguments ("D:/...Kopie.txt", "+append", and "D:/...Kopie.jpg"). Text entered at a shell prompt is split at whitespace boundaries. This same splitting does not happen in lisp strings.

Post Reply