From a660613f86d10eeba1cb1232c29ab056e782d8f0 Mon Sep 17 00:00:00 2001 From: giraffedata Date: Thu, 5 May 2016 16:35:07 +0000 Subject: cleanup - don't use shell to run Pamscale git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@2753 9d0c8265-081b-0410-96cb-a4ca84ce46f8 --- other/pamlookup.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'other/pamlookup.c') diff --git a/other/pamlookup.c b/other/pamlookup.c index 4ceb047f..d57546d9 100644 --- a/other/pamlookup.c +++ b/other/pamlookup.c @@ -99,7 +99,8 @@ fitLookup(tuple ** const inputLookup, /*---------------------------------------------------------------------------- Scale the lookup table image so that it has dimensions 'cols' x 'rows'. -----------------------------------------------------------------------------*/ - const char * pamscaleCommand; + const char * widthArg; + const char * heightArg; struct pamtuples inPamtuples; struct pamtuples outPamtuples; @@ -107,18 +108,21 @@ fitLookup(tuple ** const inputLookup, fitLookuppamP->width = cols; fitLookuppamP->height = rows; - pm_asprintf(&pamscaleCommand, "pamscale -width=%u -height=%u", cols, rows); + pm_asprintf(&widthArg, "-width=%u", cols); + pm_asprintf(&heightArg, "-height=%u", rows); inPamtuples.pamP = (struct pam *) &inputLookuppam; inPamtuples.tuplesP = (tuple ***) &inputLookup; outPamtuples.pamP = fitLookuppamP; outPamtuples.tuplesP = fitLookupP; - pm_system(&pm_feed_from_pamtuples, &inPamtuples, - &pm_accept_to_pamtuples, &outPamtuples, - pamscaleCommand); + pm_system_lp("pamscale", + &pm_feed_from_pamtuples, &inPamtuples, + &pm_accept_to_pamtuples, &outPamtuples, + "pamscale", widthArg, heightArg, NULL); - pm_strfree(pamscaleCommand); + pm_strfree(heightArg); + pm_strfree(widthArg); } -- cgit 1.4.1