Comments (13)
@CalvinJamesHeath, if you use the canvas to get the cropped image, you can use the native approach:
const canvas = cropper.getCanvas({
height: 600,
width: 600,
})
from react-advanced-cropper.
stencilProps={{
grid: true,
movable: cropperEnabled,
resizable: cropperEnabled,
lines: cropperEnabled,
handlers: cropperEnabled,
rotatable: cropperEnabled,
overlayClassName: cn(
'image-editor__cropper-overlay',
!cropperEnabled && 'image-editor__cropper-overlay--faded',
),
}}
from react-advanced-cropper.
So at advanced cropper it says : To customize the default stencils you should pass props to stencilProps props as object (read link in detail). However the link is broken.
from react-advanced-cropper.
@CalvinJamesHeath, do you want to get the following result?
from react-advanced-cropper.
I'm attempting to accomplish the following with the CircleStencil or any other tool you deem appropriate.
What I want to achieve:
What I get with the default configuration:
Also with the desired oval cropped image, I also want to show the image preview besides the cropper.
Thank you @Norserium
from react-advanced-cropper.
And the desired cropper should not strech all the way to the circle stencil, but only to the width of the oval stencil
from react-advanced-cropper.
// // ellipse / oval css .advanced-cropper-circle-stencil__draggable-area, .advanced-cropper-circle-stencil__overlay, .advanced-cropper-circle-stencil__preview, .advanced-cropper-circle-stencil__grid { position: relative; height: 100%; width: 90% !important; }; What I targeted for the example
from react-advanced-cropper.
@CalvinJamesHeath, I don't get you. The circle stencil limits aspect ratio to 1/1
, so you should create your own stencil or customize the rectangle stencil.
from react-advanced-cropper.
Well then I guess my question is how to do that. Can you pass a default aspect ratio that can expand or shrink but always look like an oval? I opened another issue before because the "Create your own Custom Stencil section link" was invalid.
Thanks again.
from react-advanced-cropper.
So I added stencilProps={{aspectRatio: 4 / 5, }} for an ellipse/oval aspect.
How do I get back the preview lines or oval shape inside the handler? Because the previewClassName only shows if Im using the CircleStencil.
from react-advanced-cropper.
The preview className works perfectly, I used:
.preview { border: dashed 2px rgba(255, 255, 255, 0.764); border-radius: 50%; }
Thank you.
from react-advanced-cropper.
@CalvinJamesHeath, you are welcome!
from react-advanced-cropper.
I have a question about image cropping. When I load an image into the cropper, it has its unique width and height. However, when I save the cropped image and resize it to be 600x600 in the backend, the resulting image dimensions differ from the initial cropped dimensions.
Is there a way to set a predetermined width and height for any image added to ensure consistency in the final cropped image?
from react-advanced-cropper.
Related Issues (20)
- Applying a transform to the preview only HOT 10
- Preview to Canvas? HOT 4
- How to make stencil to minWidth and minHeight.
- Blinking issue with the image on page loads. HOT 2
- Unable to Change Wrapper Color to White HOT 5
- URGENT - Image wrongly sized on Safari HOT 7
- Mouse resizing doesn't work HOT 5
- How to set the maximum zoom? HOT 1
- When rotating, the cropper coordinates change and the visible area becomes cropped HOT 1
- How to implement undo redo functionality while editing image? HOT 1
- Reposition Cropper for Progressively Loaded High Resolution Image HOT 1
- Image is not viewed in full size based on the crop HOT 2
- Only in Safari for a Portrait image after cropping when saving it shifts to the left hand side HOT 1
- Image load not taking entire wrapper height HOT 2
- Image reduced in height when taken with camera HOT 1
- Cropper for multiple images HOT 5
- Is it possible to set the stencil coordinates? HOT 3
- Breaking change in 0.19.5 from 0.19.4 (a patch version!) HOT 2
- The file size of the image actually increases by almost 10 times after cropping 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 react-advanced-cropper.