advanced-cropper / vue-advanced-cropper

The advanced vue cropper library that gives you opportunity to create your own croppers suited for any website design
https://advanced-cropper.github.io/vue-advanced-cropper/
Other
1k stars 136 forks source link

How set initial rotate #174

Closed bryanvam closed 2 years ago

bryanvam commented 2 years ago

I know there is a method to rotate. I would like to set the default rotate for when I am restoring a image from the server, I have its user rotated value saved. I would like to load this rotated value as part of loading the image, instead of triggering it via a method.

Norserium commented 2 years ago

@bryanvam, why do you object to triggering rotate via a method?

I assume you want to pass defaultTransforms (object or function) to Cropper as a prop. Am I right?

I had plans to implement it in react-advanced-cropper, and I can do something similar here.

defaultTransforms: ImageTransform | (image: CropperImage) => ImageTransform
bryanvam commented 2 years ago

@Norserium 100% right. the main reason is that the image loads and then you see it rotate. the same goes for inital co-ordinates. but the rotate is the most important for me

Norserium commented 2 years ago

@bryanvam, well, I have pretty few time right now. Do you have any deadlines associated with this issue?

Norserium commented 2 years ago

@bryanvam, I plan to investigate the solution next weekends. But if you have some sort of deadlines I can try to force it.

bryanvam commented 2 years ago

@Norserium i appreciate you looking into this. i can work around your timeline of next weekend.

Norserium commented 2 years ago

@bryanvam, I've published and documented defaultTransforms property. It's available since 1.10.0 / 2.8.0. You can find the example in the "Default transforms" section.

Norserium commented 2 years ago

@bryanvam, any news?

bryanvam commented 2 years ago

@Norserium many thanks. this is working great. much appreciated

Norserium commented 2 years ago

@bryanvam, you are welcome!