A parameter containing real numbers not accepted on Linux

Clash Royale CLAN TAG#URR8PPP up vote
1
down vote
favorite
Firstly, this command works on Windows command prompt well.
kdu_expand -i /home/tmp/1.jp2 -o /home/tmp/1.tif -region 0.1,0.1,0.1,0.1
In Linux, I get the following error:
The `-region' argument requires a set of coordinates of the form, "<top>,<left>,<height>,<width>". All quantities must be real numbers in the range 0 to 1.
If I remove the -region parameter and run like this:
kdu_expand -i /home/tmp/1.jp2 -o /home/tmp/1.tif
it works on Linux too.
Here is the part of the code which parses the parameter:
static void
set_region_of_interest(kdu_args &args, kdu_dims ®ion, siz_params *siz,
double &width_fraction, double &height_fraction)
/* Parses the `-region' argument to see if a reduced region of interest
is required. Returns the region of interest, expressed on the
original codestream canvas (no geometric transformations) along with
the fraction of the full image width and height which are represented
by this region. */
width_fraction = height_fraction = 1.0;
if (!(siz->get(Sorigin,0,0,region.pos.y) &&
siz->get(Sorigin,0,1,region.pos.x) &&
siz->get(Ssize,0,0,region.size.y) &&
siz->get(Ssize,0,1,region.size.x)))
assert(0);
region.size.y -= region.pos.y;
region.size.x -= region.pos.x;
if (args.find("-region") == NULL)
return;
char *string = args.advance();
if (string != NULL)
double top, left, height, width;
if (sscanf(string,"%lf,%lf,%lf,%lf",&top,&left,&height,&width) != 4)
string = NULL;
else if ((top < 0.0)
if (string == NULL)
kdu_error e; e << "The `-region' argument requires a set of coordinates "
"of the form, "<top>,<left>,<height>,<width>". All quantities "
"must be real numbers in the range 0 to 1.";
args.advance();
command-line
add a comment |Â
up vote
1
down vote
favorite
Firstly, this command works on Windows command prompt well.
kdu_expand -i /home/tmp/1.jp2 -o /home/tmp/1.tif -region 0.1,0.1,0.1,0.1
In Linux, I get the following error:
The `-region' argument requires a set of coordinates of the form, "<top>,<left>,<height>,<width>". All quantities must be real numbers in the range 0 to 1.
If I remove the -region parameter and run like this:
kdu_expand -i /home/tmp/1.jp2 -o /home/tmp/1.tif
it works on Linux too.
Here is the part of the code which parses the parameter:
static void
set_region_of_interest(kdu_args &args, kdu_dims ®ion, siz_params *siz,
double &width_fraction, double &height_fraction)
/* Parses the `-region' argument to see if a reduced region of interest
is required. Returns the region of interest, expressed on the
original codestream canvas (no geometric transformations) along with
the fraction of the full image width and height which are represented
by this region. */
width_fraction = height_fraction = 1.0;
if (!(siz->get(Sorigin,0,0,region.pos.y) &&
siz->get(Sorigin,0,1,region.pos.x) &&
siz->get(Ssize,0,0,region.size.y) &&
siz->get(Ssize,0,1,region.size.x)))
assert(0);
region.size.y -= region.pos.y;
region.size.x -= region.pos.x;
if (args.find("-region") == NULL)
return;
char *string = args.advance();
if (string != NULL)
double top, left, height, width;
if (sscanf(string,"%lf,%lf,%lf,%lf",&top,&left,&height,&width) != 4)
string = NULL;
else if ((top < 0.0)
if (string == NULL)
kdu_error e; e << "The `-region' argument requires a set of coordinates "
"of the form, "<top>,<left>,<height>,<width>". All quantities "
"must be real numbers in the range 0 to 1.";
args.advance();
command-line
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
Firstly, this command works on Windows command prompt well.
kdu_expand -i /home/tmp/1.jp2 -o /home/tmp/1.tif -region 0.1,0.1,0.1,0.1
In Linux, I get the following error:
The `-region' argument requires a set of coordinates of the form, "<top>,<left>,<height>,<width>". All quantities must be real numbers in the range 0 to 1.
If I remove the -region parameter and run like this:
kdu_expand -i /home/tmp/1.jp2 -o /home/tmp/1.tif
it works on Linux too.
Here is the part of the code which parses the parameter:
static void
set_region_of_interest(kdu_args &args, kdu_dims ®ion, siz_params *siz,
double &width_fraction, double &height_fraction)
/* Parses the `-region' argument to see if a reduced region of interest
is required. Returns the region of interest, expressed on the
original codestream canvas (no geometric transformations) along with
the fraction of the full image width and height which are represented
by this region. */
width_fraction = height_fraction = 1.0;
if (!(siz->get(Sorigin,0,0,region.pos.y) &&
siz->get(Sorigin,0,1,region.pos.x) &&
siz->get(Ssize,0,0,region.size.y) &&
siz->get(Ssize,0,1,region.size.x)))
assert(0);
region.size.y -= region.pos.y;
region.size.x -= region.pos.x;
if (args.find("-region") == NULL)
return;
char *string = args.advance();
if (string != NULL)
double top, left, height, width;
if (sscanf(string,"%lf,%lf,%lf,%lf",&top,&left,&height,&width) != 4)
string = NULL;
else if ((top < 0.0)
if (string == NULL)
kdu_error e; e << "The `-region' argument requires a set of coordinates "
"of the form, "<top>,<left>,<height>,<width>". All quantities "
"must be real numbers in the range 0 to 1.";
args.advance();
command-line
Firstly, this command works on Windows command prompt well.
kdu_expand -i /home/tmp/1.jp2 -o /home/tmp/1.tif -region 0.1,0.1,0.1,0.1
In Linux, I get the following error:
The `-region' argument requires a set of coordinates of the form, "<top>,<left>,<height>,<width>". All quantities must be real numbers in the range 0 to 1.
If I remove the -region parameter and run like this:
kdu_expand -i /home/tmp/1.jp2 -o /home/tmp/1.tif
it works on Linux too.
Here is the part of the code which parses the parameter:
static void
set_region_of_interest(kdu_args &args, kdu_dims ®ion, siz_params *siz,
double &width_fraction, double &height_fraction)
/* Parses the `-region' argument to see if a reduced region of interest
is required. Returns the region of interest, expressed on the
original codestream canvas (no geometric transformations) along with
the fraction of the full image width and height which are represented
by this region. */
width_fraction = height_fraction = 1.0;
if (!(siz->get(Sorigin,0,0,region.pos.y) &&
siz->get(Sorigin,0,1,region.pos.x) &&
siz->get(Ssize,0,0,region.size.y) &&
siz->get(Ssize,0,1,region.size.x)))
assert(0);
region.size.y -= region.pos.y;
region.size.x -= region.pos.x;
if (args.find("-region") == NULL)
return;
char *string = args.advance();
if (string != NULL)
double top, left, height, width;
if (sscanf(string,"%lf,%lf,%lf,%lf",&top,&left,&height,&width) != 4)
string = NULL;
else if ((top < 0.0)
if (string == NULL)
kdu_error e; e << "The `-region' argument requires a set of coordinates "
"of the form, "<top>,<left>,<height>,<width>". All quantities "
"must be real numbers in the range 0 to 1.";
args.advance();
command-line
edited May 15 at 16:07
Melebius
3,66041636
3,66041636
asked May 15 at 9:00
Nevermore
1123
1123
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
3
down vote
accepted
The parameter 0.1,0.1,0.1,0.1 is subject to the brace expansion in Linux shell. You can check it with echo:
$ echo 0.1,0.1,0.1,0.1
0.1,0.1 0.1,0.1 0.1,0.1 0.1,0.1
$ echo A0.1,0.1,0.1,0.1B
A0.1,0.1B A0.1,0.1B A0.1,0.1B A0.1,0.1B
To prevent this behavior, enclose the parameter into single quotes ('...').
kdu_expand -i /home/tmp/1.jp2 -o /home/tmp/1.tif -region '0.1,0.1,0.1,0.1'
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
accepted
The parameter 0.1,0.1,0.1,0.1 is subject to the brace expansion in Linux shell. You can check it with echo:
$ echo 0.1,0.1,0.1,0.1
0.1,0.1 0.1,0.1 0.1,0.1 0.1,0.1
$ echo A0.1,0.1,0.1,0.1B
A0.1,0.1B A0.1,0.1B A0.1,0.1B A0.1,0.1B
To prevent this behavior, enclose the parameter into single quotes ('...').
kdu_expand -i /home/tmp/1.jp2 -o /home/tmp/1.tif -region '0.1,0.1,0.1,0.1'
add a comment |Â
up vote
3
down vote
accepted
The parameter 0.1,0.1,0.1,0.1 is subject to the brace expansion in Linux shell. You can check it with echo:
$ echo 0.1,0.1,0.1,0.1
0.1,0.1 0.1,0.1 0.1,0.1 0.1,0.1
$ echo A0.1,0.1,0.1,0.1B
A0.1,0.1B A0.1,0.1B A0.1,0.1B A0.1,0.1B
To prevent this behavior, enclose the parameter into single quotes ('...').
kdu_expand -i /home/tmp/1.jp2 -o /home/tmp/1.tif -region '0.1,0.1,0.1,0.1'
add a comment |Â
up vote
3
down vote
accepted
up vote
3
down vote
accepted
The parameter 0.1,0.1,0.1,0.1 is subject to the brace expansion in Linux shell. You can check it with echo:
$ echo 0.1,0.1,0.1,0.1
0.1,0.1 0.1,0.1 0.1,0.1 0.1,0.1
$ echo A0.1,0.1,0.1,0.1B
A0.1,0.1B A0.1,0.1B A0.1,0.1B A0.1,0.1B
To prevent this behavior, enclose the parameter into single quotes ('...').
kdu_expand -i /home/tmp/1.jp2 -o /home/tmp/1.tif -region '0.1,0.1,0.1,0.1'
The parameter 0.1,0.1,0.1,0.1 is subject to the brace expansion in Linux shell. You can check it with echo:
$ echo 0.1,0.1,0.1,0.1
0.1,0.1 0.1,0.1 0.1,0.1 0.1,0.1
$ echo A0.1,0.1,0.1,0.1B
A0.1,0.1B A0.1,0.1B A0.1,0.1B A0.1,0.1B
To prevent this behavior, enclose the parameter into single quotes ('...').
kdu_expand -i /home/tmp/1.jp2 -o /home/tmp/1.tif -region '0.1,0.1,0.1,0.1'
answered May 15 at 9:28
Melebius
3,66041636
3,66041636
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1036431%2fa-parameter-containing-real-numbers-not-accepted-on-linux%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password