Error while executing convert (imagemagick) in cygwin - cygwin

I am trying to resize an image in windows. I have a shell script which I am executing using cygwin. Script is working fine. But I am unable to execute convert (imagmagick). I am getting the following error when I am executing the convert command.
`$ convert /cygdrive/c/Users/myUser/Desktop/9121.JPG -resize 50% a.png
Error : convert.exe: unable to open image /cygdrive/c/Users/myUser/Desktop/9121.JPG': No such file or directory # error/blob.c/OpenBlob/2701.
convert.exe: no images defineda.png' # error/convert.c/ConvertImageCommand/3230.
Please help me. Thanks.

Please set path variable to convert.exe path location, and then execute convert command

Related

How to run the particular file in absolute path?

I have Files called enum-pipeline-2.conf enum-ruby-filter-2.rb get_session_msgs_query.json lookup.json, which I was running by giving ./file_name in my linux script. I wanted to run those files using absolute path.
When I am trying to find it
readlink -f get_session_msgs_query.json --->
/root/PWG/logstash-pipelines/enum/logstash_templates/get_session_msgs_query.json
This I am getting, Can anyone please help how to run it in linux?

Pyreverse fails to generate any output files (png, jpg) other than .dot files

I am attempting to use pylint's pyreverse to generate uml diagrams of some .
When I run pyreverse from the command shell
pyreverse <modulename>
It executes just fine and returns a *.dot file as it should. If I attempt to use output options such as "-o png" I get the following error
>pyreverse -o png <modulename>
'c:\Program' is not recognized as an internal or external command,
operable program or batch file.
I am running python 3.6.5 and pylint 2.1.1.
I have installed graphviz 2.38 under C:\Programs and added the bin directory to my windows path.
I suspect pyreverse is recognizing some command as a command and a set of arguments (e.g. "C:\Program Files\blah blah" is being sent as a command to the windows interpreter as "C:\Program", but I do not know where, or how to fix it.
Can anyone offer any solutions?
That is a bug as the commenter suggested.
In the meanwhile, install graphviz, so that dot is on the path, then run
dot -Tpng classes.dot>result.png

wkhtmltopdf: No such file or directory [ Closed ]

I installed wkhtmltopdf from the following code
sudo apt-get install wkhtmltopdf
But when I am creating PDF then it is generating following error
Error: /bin/bash: /usr/bin/wkhtmltopdf: No such file or directory
I think the correct path would be /usr/local/bin/wkhtmltopdf. You can get it by which wkhtmltopdf command.
It appears that when you're trying to run wkhtmltopdf, it's not finding the program to execute.
You can try to locate it with locate wkhtmltopdf. That should return the path to the executable. If that doesn't return a path, you can use this (but it will take longer): find / -name wkhtmltopdf 2>/dev/null.
Once you've got the path of the executable, make sure to add it to your $PATH, so it can be called from anywhere on the command line. See this post for instructions on how to add to the path variable.
After a long time facing this issue I decided to replace it by another converter.
I removed wkhtmltopdf and I installed html-pdf converter and then PDF file created successfullu

OpenCV error: Image step is wrong

I'm going through this tutorial: http://docs.opencv.org/trunk/modules/contrib/doc/facerec/tutorial/facerec_video_recognition.html#creating-the-csv-file
Everything goes well, but running the face recognition script gives this error:
OpenCV Error: Image step is wrong (The matrix is not continuous, thus its number of rows can not be changed)
I'm using Ubuntu so I'm not exactly sure how to implement the solution found here: Getting OpenCV Error "Image step is wrong" in Fisherfaces.train() method
I rebuilt in debug mode but that had no effect.
Recently I faced the same error with this face recognition example. I got rid of the error by giving same ratio(1:1) images.
Crop the images using this script (see this as well Command line batch image cropping tool)
#!/bin/bash
width=92;
height=92;
x_offset=0;
y_offset=10;
filelist=`ls | grep '.pgm'`
for image_file in $filelist
do
convert -crop ${width}x${height}+${x_offset}+${y_offset} \
$image_file $image_file
done
this will crop the images in a folder, so u need to put this script in the same directory where your images are.
Also you should give absolute path inside the csv file.

unoconv not working while trying to convert. throws Error: Unable to connect or start own listener. Aborting

I am trying to convert docx to pdf using unoconv, but getting Error: Unable to connect or start own listener. Aborting. when I run unoconv -f pdf 1234.docx.
So, there must be some listener. I then started the listener via unoconv --listener.
I tried ps aux | grep soffice, and found soffice.bin.
So I tried unoconv -f pdf 1234.docx again. It still gave me the same error: Error: Unable to connect or start own listener. Aborting.
What am I doing wrong here?
You have to kill all the soffice.bin processes before trying to use unoconv. I didn't have to do any "unoconv --listener" command.
You need to kill all soffice.bin processes before executing unoconv
It fails with the error in the question if it does not find the LibreOffice personal configuration file, but it also creates them before exiting.
The second run succeeds.
You can reproduce the error but removing the personal configuration files, then trying to run unoconv:
$ rm -rf .config/libreoffice/
$ unoconv foo
Error: Unable to connect or start own listener. Aborting.
https://github.com/dagwieers/unoconv/issues/241
Failing to start instance hints at the inability of the script to find the LibreOffice program.
Do this basic test:
Copy the unoconverter to "libreoffice/program" folder.
IMPORTANT: Go there and try to execute ./soffice to verify that the soffice runs itself.
Now run unoconv with the version of python that shipped with the LibreOffice by typing ./python unocov -f pdf 1234.docx
You should see the converted file in the same directory now. Kill the soffice process and retry if it generates the same error.
unoconv does not support .docx / .pptx etc.
You need to use the old document extension, which is .doc, .ppt.
A simple rename would probably solve the problem.

Resources