-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve image rotation #4639
Improve image rotation #4639
Conversation
ImageEditor - naturalWidth -> width ImageEditor - rename imageData to canvasData (bc it's canavasData!) ImageEditor - add comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice change and the code LGTM.
What about your notes? Can we create issue(s) for it so we can track it?
@Murderlon, I will keep working on those after this PR is merged. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noticed a minor issue: max clockwise rotation value is 44° in my browser. I expected to see 45° :) |
tooltips
Another thought: if we already have tooltips, can we show them when hovering the other buttons (Reset, Rotate 90deg, etc)? Think it could make the UI friendlier.
This used to work like that, it's a bug, I think Evgenia has it on her list.
|
Yes, also thought that would be nice, the following cryptic #todo describes this behaviour:
Makes sense, will update to 45° in the next PR. |
| Package | Version | Package | Version | | ------------------ | ------- | ------------------ | ------- | | @uppy/companion | 4.9.0 | @uppy/locales | 3.3.1 | | @uppy/compressor | 1.0.3 | @uppy/tus | 3.3.0 | | @uppy/dashboard | 3.5.3 | uppy | 3.16.0 | | @uppy/image-editor | 2.2.0 | | | - @uppy/tus: Fix: Utilize user-defined onSuccess, onError, and onProgress callbacks in @uppy/tus (choi sung keun / #4674) - @uppy/dashboard: Make file-editor:cancel event fire when the Image Editor “cancel” button is pressed (Artur Paikin / #4684) - @uppy/companion: add missing credentialsURL for box (Mikael Finstad / #4681) - @uppy/companion: remove s3 endpoints if s3 disabled (Mikael Finstad / #4675) - meta: use latest Node.js version for tests (Antoine du Hamel / #4662) - meta: Improve Contributing.md (Evgenia Karunus / #4633) - @uppy/compressor: update file.meta.name after compression, becase format/extension might have changed (Artur Paikin / #4645) - @uppy/companion: Onedrive refresh tokens (Mikael Finstad / #4655) - @uppy/companion: catch "invalid initialization vector" instead of crashing (Mikael Finstad / #4661) - @uppy/image-editor: Improve image rotation (Evgenia Karunus / #4639) - @uppy/locales: Feature/updating i18n farsi (Parsa Arvaneh / #4638)
This PR
[-45°, 45°]
range (previously we saw values such as-59°
)Notes
requestAnimationFrame
code temporarily while developing. Should we add it back, is there some issue/use case that it helps solve that we can observe in action?Further ideas (notes for myself)
make "granular rotation" and "90 deg rotation" work around the cropbox center instead of image center (cropper 1 doesn't support this RotateTo should occur on cropbox center coordinates fengyuanchen/cropperjs#580, but we can do it manually)[decided against it]disable scale-on-rotation if the cropbox doesn't exactly match the original-nonrotated-image-position[decided against it]prohibit cropbox movement to the empty cornersreadd labels on hover over buttonson<input type="range">
data-microtip-position should follow the user mouse if possiblemake rotation [-45, 45] instead of [-44, 45]fix this autoCrop on Image editor (React) does not work. #4666Screen.Recording.2023-08-25.at.16.36.49.mov