musama619/react-photo-editor

Aspect ratio squished

Closed this issue · 4 comments

Hello there, I'm trying to use the photo editor in a project and I've found something that may just be my own fault, perhaps you can help.

Whenever I try to edit pictures that are shot in portrait (so height is bigger than width), the images get squished. If I resize the window to appropriate shape, the dialog also gets narrower and the aspect ratio goes back to normal.

I'm able to reproduce it within the stackblitz demo, try it using this random photo from the internet: https://images.pexels.com/photos/1770809/pexels-photo-1770809.jpeg?cs=srgb&dl=pexels-luisdalvan-1770809.jpg&fm=jpg

Thank you very much for the help!

Hi, i am doing some research and when i remove w-100 from canvas it works.
(only i turn it off in develper tools, slider below image needs it for full width)

image

@filtkac Thanks a lot for pointing this out! I've made some adjustments to address the squishing issue with portrait-oriented images in the photo editor dialog. Now, the aspect ratio should be maintained properly.

@JosefSchovanec, you are right I removed w-100 and set width: 'auto'!

I have published a test release react-photo-editor@2.1.4-rc.1
Can be tested from demo link.

I have added some new props that allow for a more flexible configuration of canvas and modal 14ac93a. Let me know how these changes work for you, and if you'd like to see any other improvements or features.

Hi @musama619,
i have tried your changes and its works, thank you.

Can we have some other request for changes? Application when is Photo editor included is multi-languages. Can you add some props where we can pass translations?

Thanks again.

@JosefSchovanec Thanks for the suggestion about multi-language support. This is a great idea and I plan to add this in a few days.