Problems with GhostScript and nconvert

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

Moderators: XnTriq, helmut, xnview

User avatar
khaledhawari
Posts: 11
Joined: Tue Mar 06, 2012 8:41 am

Re: Problems with GhostScript and nconvert

Post by khaledhawari »

Hey Pierre,

this is the output i got :


C:\Users\Administrator>nconvert -use_cie -org_depth -dpi 72 -q 100 -thumb 800 800 -overwrite -out jpeg -in pdf -o "C:/aya13.jpeg" "C:/aya13.pdf"

GSCheck C:\general\gs\gs9.05\bin\gsdll32.dll C:\general\gs\gs9.05\bin
Error: Don't know how to read this picture (C:/aya13.pdf)
User avatar
xnview
Author of XnView
Posts: 43601
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Problems with GhostScript and nconvert

Post by xnview »

khaledhawari wrote: GSCheck C:\general\gs\gs9.05\bin\gsdll32.dll C:\general\gs\gs9.05\bin
And the path is good?
Pierre.
User avatar
khaledhawari
Posts: 11
Joined: Tue Mar 06, 2012 8:41 am

Re: Problems with GhostScript and nconvert

Post by khaledhawari »

yes the path is correct. i have installed in that path...

if i type "gswin32c" in command line, ghostscript is called normally.

what i have found is that when i open a php file from my browser like the following :

Code: Select all

<?php
echo "starting...";
exec('nconvert -use_cie -org_depth  -dpi 72 -q 100 -thumb 800 800 -overwrite -out jpeg -in pdf -o "C:/aya13.jpeg" "C:/aya13.pdf"' , $out , $res);
echo $res;
echo "finished";
sleep(100);
?>

the jpeg is created normally, yet when i take the exact same command

Code: Select all

nconvert -use_cie -org_depth  -dpi 72 -q 100 -thumb 800 800 -overwrite -out jpeg -in pdf -o "C:/aya13.jpeg" "C:/aya13.pdf"
i get the error! this is what is confusing me, why is it that when i call the php file i can convert yet when i run as command line i cannot.
if it helps, i have configured my server to run PHP as a module of Apache....
User avatar
xnview
Author of XnView
Posts: 43601
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Problems with GhostScript and nconvert

Post by xnview »

how do you start nconvert? Not with exec?
Pierre.
User avatar
khaledhawari
Posts: 11
Joined: Tue Mar 06, 2012 8:41 am

Re: Problems with GhostScript and nconvert

Post by khaledhawari »

i run it from command prompt :

Code: Select all

C:\Users\Administrator>nconvert output.jpg input.jpg
in my case i require it to run from the command line because my application has batch scripts that run and generate thumbs.
User avatar
xnview
Author of XnView
Posts: 43601
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Problems with GhostScript and nconvert

Post by xnview »

Sorry but i don't understand. If you run nconvert as command line, it works. And if you start it by exec in php it doesn't work, right?
Pierre.
User avatar
khaledhawari
Posts: 11
Joined: Tue Mar 06, 2012 8:41 am

Re: Problems with GhostScript and nconvert

Post by khaledhawari »

no it is the other way around, from php it works, from command line it doesnt.

I know i am causing you headache but this is really frustrating for me !
User avatar
xnview
Author of XnView
Posts: 43601
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Problems with GhostScript and nconvert

Post by xnview »

With debug version of nconvert, do you have same output in the 2 cases?
Pierre.
User avatar
khaledhawari
Posts: 11
Joined: Tue Mar 06, 2012 8:41 am

Re: Problems with GhostScript and nconvert

Post by khaledhawari »

alright i think its resolved!!

it was a privilege issue from command line ! i run my scripts as services , so i had to give them full administrator privilege from the services > log in as administrator, then restarted my machine and its resolved!

i will now revert back to the old versions and confirm if this was the case.

Thank you so so much for all your assistance.
Post Reply