Code Monkey home page Code Monkey logo

Comments (3)

toddalbert avatar toddalbert commented on May 26, 2024 8

Hey @djfdev
I'm using this library and doing rotation as well. I created a rotation button that rotates by -90 deg (although you could create a slider or other controller that does in smaller increments). I then update my rotation in state and pass that through to the ReactCrop component as imageStyle props. If I pass a {transform: 'rotate(' + this.state.rotation + 'deg)'} to the imageStyle props on the ReactCrop component, it works pretty well.
Hope this helps!

from react-image-crop.

sekoyo avatar sekoyo commented on May 26, 2024

Hi @djfdev, sorry but this is indeed beyond the scope of this library. It's too specific a use-case and I don't have the inclination to support that much of an extended feature set tbh. But if I was you I would create a higher order component (one which wraps this one or another lib) and adds that prop and does what you desire, it sounds like it could be pretty agnostic of the actual cropping component which sits underneath so that could be swapped out if ever needed.

from react-image-crop.

nikhilwankhede98 avatar nikhilwankhede98 commented on May 26, 2024

Hi.. I am having functionality of crop and rotate an image using this package and I am getting the cropped image url using
"canvas.toDataURL("image/jpeg", 1)". I am generating this url to display the cropped image. But the issue I am facing is that while rotating, I have to maintain the rotation degree state in my Component. But instead, I want to add the rotation property in the imag url itself that I am generating since I need to pass this url to the backend.. Does anyone have a solution to this requirement?
Thanks in advance

from react-image-crop.

Related Issues (20)

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.