A parameter containing real numbers not accepted on Linux

The name of the pictureThe name of the pictureThe name of the pictureClash 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 &region, 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();







share|improve this question


























    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 &region, 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();







    share|improve this question
























      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 &region, 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();







      share|improve this question














      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 &region, 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();









      share|improve this question













      share|improve this question




      share|improve this question








      edited May 15 at 16:07









      Melebius

      3,66041636




      3,66041636










      asked May 15 at 9:00









      Nevermore

      1123




      1123




















          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'





          share|improve this answer




















            Your Answer







            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "89"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            convertImagesToLinks: true,
            noModals: false,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );








             

            draft saved


            draft discarded


















            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






























            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'





            share|improve this answer
























              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'





              share|improve this answer






















                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'





                share|improve this answer












                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'






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered May 15 at 9:28









                Melebius

                3,66041636




                3,66041636






















                     

                    draft saved


                    draft discarded


























                     


                    draft saved


                    draft discarded














                    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













































































                    Popular posts from this blog

                    How do so many people here on Academia.SE, and in general, afford lavish higher education programs?

                    Trouble downloading packages list due to a “Hash sum mismatch” error

                    How do I move numbers in filenames, in a batch renaming operation?