melistik / vaadin-jcrop

Vaadin wrapping for the jQuery plugin jCrop
https://vaadin.com/directory#!addon/jcrop-wrapper
MIT License
3 stars 2 forks source link

Selection causes a NumberFormatException #7

Open fedemg opened 8 years ago

fedemg commented 8 years ago

Hi there! I'm trying to make a basic cropping feature for a profile picture in our application using the vaadin-jcrop add on.

The problem is that, after uploading a new image and setting it as the source to jcrop (using the FileResource class) any selection causes a NumberFormatException as the json interpreter of vaadin tries to convert a float to an int (I copy the relevant part of the stack trace).

SEVERE: java.lang.NumberFormatException: For input string: "1375.368888888889" at java.lang.NumberFormatException.forInputString(Unknown Source) at java.lang.Integer.parseInt(Unknown Source) at java.lang.Integer.valueOf(Unknown Source) at com.vaadin.server.JsonCodec.decodeInternalType(JsonCodec.java:414) at com.vaadin.server.JsonCodec.decodeInternalOrCustomType(JsonCodec.java:272) at com.vaadin.server.communication.ServerRpcHandler.parseServerRpcInvocation(ServerRpcHandler.java:476) at com.vaadin.server.communication.ServerRpcHandler.parseInvocation(ServerRpcHandler.java:409) at com.vaadin.server.communication.ServerRpcHandler.parseInvocations(ServerRpcHandler.java:352) at com.vaadin.server.communication.ServerRpcHandler.handleInvocations(ServerRpcHandler.java:218) at com.vaadin.server.communication.ServerRpcHandler.handleRpc(ServerRpcHandler.java:180) at com.vaadin.server.communication.UidlRequestHandler.synchronizedHandleRequest(UidlRequestHandler.java:93) at com.vaadin.server.SynchronizedRequestHandler.handleRequest(SynchronizedRequestHandler.java:41) at com.vaadin.server.VaadinService.handleRequest(VaadinService.java:1406) at com.vaadin.server.VaadinServlet.service(VaadinServlet.java:305) at at.workflow.webdesk.tools.webclient.GlobalContextAwareServlet.service(GlobalContextAwareServlet.java:60) at javax.servlet.http.HttpServlet.service(HttpServlet.java:848) ...