Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot parse parameter left as Int #53

Open
zuowang opened this issue Feb 8, 2017 · 3 comments
Open

Cannot parse parameter left as Int #53

zuowang opened this issue Feb 8, 2017 · 3 comments

Comments

@zuowang
Copy link

zuowang commented Feb 8, 2017

For request 'GET /save_bounding_box?name=026.jpg&left=150.39996337890625&right=74.39996337890625&top=166.8000030517578&bottom=28.800003051757812&width=218&height=292' [Cannot parse parameter left as Int: For input string: "150.39996337890625"]

@plippe
Copy link
Collaborator

plippe commented Feb 8, 2017

Hi Zuo Wang,

You aren't giving much in term of information.

Which script did you try to run ?
Would you have the full stack trace and not just the error ?

If I had to make a guess, the script it trying to convert "150.39996337890625" to an int (Cannot parse parameter left as Int). The issue is that it isn't an int, it is a string representation of a decimal.

Would you have more information for us to help you ?

@zuowang
Copy link
Author

zuowang commented Feb 8, 2017

Yes, I opened http://localhost:9000/bounding_box, then created bounding boxes and clicked save button to store them into the database. It got 4 decimal: left, right, top, bottom, but the bound handler requires Int type. It works when I added parseInt() in BoundingBoxEditor.js.

   $scope.saveButton.addEventListener("click", function(){
       window.location = "/save_bounding_box?" +
        "name=" + $scope.boundingBox.name +
 -      "&left=" + $scope.boundingBox.left +
 -      "&right=" + $scope.boundingBox.right +
 -      "&top=" + $scope.boundingBox.top +
 -      "&bottom=" + $scope.boundingBox.bottom +
 +      "&left=" + parseInt($scope.boundingBox.left) +
 +      "&right=" + parseInt($scope.boundingBox.right) +
 +      "&top=" + parseInt($scope.boundingBox.top) +
 +      "&bottom=" + parseInt($scope.boundingBox.bottom) +
        "&width=" + $scope.width +
        "&height=" + $scope.height;
    });

@plippe
Copy link
Collaborator

plippe commented Feb 8, 2017

What you did seems to be a good move to fix this. What browser would you be using, as it seems to work on my chrome ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants