"-info" switch problem...

Discussions on NConvert - the command line tool for image conversion and manipulation

Moderators: XnTriq, helmut, xnview

sasho
Posts: 2
Joined: Wed Dec 25, 2013 6:33 pm

"-info" switch problem...

Post by sasho »

hi all,

I'm using linux version of nconvert to convert PDF to PNG on the fly using php exec command and ghostscript and it works just fine as long as I don't specify "-info" as a part of command line. it looks something like this:

Code: Select all

<?php exec('/usr/local/nconvert -overwrite -out png -dpi 300 -ratio -resize 600 0 -colors 256 '.$move_to, $cvt_res); ?>
$move_to is name of PDF file I want to converted, and $cvt_res should be array filled with result of conversion (and lot of other stuff too). That is true if "-info" switch is specified, otherwise $cvt_res contains just copyright info wich is of no special use. I need this to test if conversion passed ok in $cvt_res[5] (if I'm not wrong). But once I specify "-info" switch like:

Code: Select all

<?php exec('/usr/local/nconvert -info -overwrite -out png -dpi 300 -ratio -resize 600 0 -colors 256 '.$move_to, $cvt_res); ?>
nconvert will not convert my files anymore. it seems like "-info" switch turns off actual conversion and works just like info.

Any hints or clues maybe?
Thanx...
User avatar
xnview
Author of XnView
Posts: 43132
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: "-info" switch problem...

Post by xnview »

yes -info will display only information about the file
Pierre.
sasho
Posts: 2
Joined: Wed Dec 25, 2013 6:33 pm

Re: "-info" switch problem...

Post by sasho »

so do you suggest me to call nconvert twice?
first time to check error and then if all is ok, do the actual conversion, or something else?

thanx...
User avatar
xnview
Author of XnView
Posts: 43132
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: "-info" switch problem...

Post by xnview »

sasho wrote:so do you suggest me to call nconvert twice?
first time to check error and then if all is ok, do the actual conversion, or something else?
yes, or do you think that command following -info must be executed?
Pierre.