Comments (22)
Unfortunately, there is not native support of this feature, but I perhaps will implement one in the future releases.
Now you can use perhaps not efficient, but working approach, that is illustrated at this example.
from vue-advanced-cropper.
@Lejla94, yes, it's. It's actually used by Preview
component alike.
from vue-advanced-cropper.
Hello, @GhaniHaa!
Do you want to rotate an image inside the cropper or rotate the result will be enough?
from vue-advanced-cropper.
both of them, it is possible ?
from vue-advanced-cropper.
Thanks for your help mate.
anyway nice pic
from vue-advanced-cropper.
You are welcome!
from vue-advanced-cropper.
@GhaniHaa, the native rotation was added in 0.19.0
. The rotate / flip example (the codesandbox).
from vue-advanced-cropper.
Hello Norserium.
I got a picture that i flip with:
this.$refs.cropper.flip(true, false);
but when the user changes the route or the picture the image is not flipped on the same way.
So it was once flipped and it should be shown flipped on these conditions.
It should persist.
On my use case i have a preview that stays flipped, but the cropper not and it confuses.
Thanks.
Is there an attribute for this use case?
from vue-advanced-cropper.
@Lejla94, could you provide the codesandbox that reproduces your issue?
from vue-advanced-cropper.
Hello Norserium.
I got a preview of the image and the cropper on the same page.
When the user clicks a button:
function setMirrorImage() {
if(mirrorImageStyle.value === '') {
mirrorImageStyle.value = 'transform: scaleX(-1);'
} else {
mirrorImageStyle.value = '';
}
this.$refs.cropper.flip(true, false);
}
then the style of the preview image changes.
And the cropper flips.
But then the user clicks on another image, the preview is still mirrored, but the cropper not.
Here is a sandbox: example
Click the images and the rotation does not persist.
if i have a preview of that image that i rotate it stays that way, but the cropper not.
By preview i mean the image shown on the site and not on the cropper.
I see the cropper refreshes when the image changes.
Thanks
from vue-advanced-cropper.
@Lejla94, I assume your codesandbox is not full (there is not the code presented in the last message). But why don't you use Preview
component? The example.
from vue-advanced-cropper.
The issue there is:
- i do not have a variable to send to the backend when the image is mirrored.
I need to use the images on my backend too. - i need when the image is saved on a variable to have a preview on another route, so i need all the coordinates and stuff.
Question: Is there a variable on the image coordinates to show the image is mirrored?
i will check that question and come back to you.
Thanks for your help.
from vue-advanced-cropper.
there is a flip on the image object,
i will use that.
Thanks for your help.
from vue-advanced-cropper.
@Norserium
Look at this sandbox
when the aspect ration is not 1 (one) the Preview does not show well!!
I want to keep the aspect ratio on the preview too, by setting only width on css or the element.
Thanks.
from vue-advanced-cropper.
Is there a way to use object-fit: contain;
on the image?
from vue-advanced-cropper.
@Lejla94, if I understood you correctly, do you want to get something like this? I don't see the point to set only the width, because you have the static aspect ratio and the height is clearly determined by the width in this case.
from vue-advanced-cropper.
Yes, but the aspect ratio will change and the Preview should keep it
from vue-advanced-cropper.
The aspect ratio changes based on the user input values, then the user chooses a part of the cropper that will reflect in the Preview.
So the Preview will keep a max width and object-fit: contain;
so it will scale to fit the max size, but keeping aspect ratio.
from vue-advanced-cropper.
@Lejla94, let's do it step by step. You can pretty easy set the width
and height
in the template. The example. But I assume it's not fit to your needs. Am I right?
from vue-advanced-cropper.
I tried this before, so the only issue is i can not change the Preview with breakpoints.
I should keep a variable as max size.
But if i find no solution, i will scale it on the css or something to make it look bigger on PC and let 320 on small devices.
Thanks for your effort, if there is someway i could help tell me. (by contributing to the project)
from vue-advanced-cropper.
@Lejla94, well, nothing is impossible. There is the old-school trick. You can use aspect-ratio
property instead if browsers supported by you support it.
from vue-advanced-cropper.
I am trying that now.
Thanks
from vue-advanced-cropper.
Related Issues (20)
- Event problem HOT 2
- Getting the color in the image at the mouse position HOT 1
- More detailed events please?? HOT 2
- I am unable to use Cropper in my bootstrap modal. HOT 2
- Cropper doesn't work after deployment. HOT 20
- Usage of the cropper in Composition API through a composable/util HOT 13
- Bug Cropper: no emit resize-end or move-end events in modal HOT 1
- 你好,如果想修改为支持:选中的区域为任意四边形(四个内角都不能大于180度)而不是矩形,需要修改哪里啊? HOT 1
- No matching version found for vue-advanced-cropper@next HOT 1
- Missing stencil and duplicate view HOT 3
- Question: How to fit image to stencil, when it first loads HOT 2
- issue: getting canvas in composition api with <script setup> HOT 1
- I want to be able to edit the image preview list by clicking on it. HOT 1
- using image restriction 'none' and aspect ratio. HOT 5
- In Vue advanced cropper , the moving class (vue-rectangle-stencil--moving) is not removing automatically when I stop moving the mouse, but if I refresh the page once means , it is removing automatically and working as expected. HOT 1
- Saving/Retrieving cropper settings to re-apply at a later time HOT 1
- How to use defaultVisibleArea with values that have a very narrow or very wide size of square stencil HOT 1
- Wrong Width Height recognition HOT 2
- Image Cropping Failure for larger Images HOT 1
- The cropped image was found to be missing pixels HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vue-advanced-cropper.