Code Monkey home page Code Monkey logo

vaadin-jcrop's Introduction

about me:

๐Ÿง‘๐Ÿผโ€๐Ÿ’ป I'm a full-stack developer based near Hamburg, Germany ๐Ÿ‡ฉ๐Ÿ‡ช
๐Ÿคฉ I love OpenSource and contribute custom libraries, many in java
๐Ÿ”ญ Always looking for interesting new projects
๐Ÿ‘ท๐Ÿผ Founder of agency that offers web development and consulting

social:

Website LinkedIn

main tech-stack

Java Spring React Kotlin TypeScript AWS Flutter JWT TailwindCSS Postgres MongoDB Docker ElasticSearch Notion Swagger Kubernetes


vaadin-jcrop's People

Contributors

melistik avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

vaadin-jcrop's Issues

setSelection does not work on initial load

The setSelection method only seems to work when the component is already visible. There is the following comment in the setSelection source code:
"set the selection of Jcrop programmatically
is only working when the component is already attached to the screen"

My use case is that a user can select and area of an image and the selection coordinates are saved to a database. At a later stage the user should be able to come back and modify the selection and I can't seem to find a way to load the jcrop area with a selection already applied to it.

Is there a way to initialize jcrop with a certain selection that is immediately shown when the component is first loaded? Or is there some kind of workaround to achieve this?

This would be a very useful feature for me.

Thanks for providing the awesome add-on.

Selection causes a NumberFormatException

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) ...

Selection not always preserved on imageUrl/resource changes

The active selection is not always preserved when setImageUrl() or setResource() is called. I can reproduce the issue with the sampler:

  1. Make a random selection
  2. Click "switchImage" or "setResource"

Result:

  • When the image is already cached, switchImage works for me,
  • setResource seems to loose the selection every time.

The information about the selection above the image however shows the correct values. Only the overlay is lost.

It seems as if the problem is related to the image loading speed. If the the image is served slowly, the selection overlay is lost.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.