Skip to content
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

Enhance Image Transformation: Aspect Ratio Transition, Rotation Fixes, and Crop Rect Improvements #714

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

Peng-Qian
Copy link

  1. Add Aspect Ratio Transition
    • Introduced a smooth transition effect when changing the aspect ratio of the image.
    https://github.com/user-attachments/assets/5e72eca7-006c-48ac-a04d-4a6d2458c99a

  2. Fix Rotation Bug
    • Resolved an issue where the image size would gradually shrink with consecutive rotations.

  3. Correct Scaling on Rotation
    • Ensured proper scaling is applied to the image when rotating, maintaining consistent dimensions.

  4. Improve Rotation with Crop Rect
    • Enhanced the rotation behavior within the cropping rectangle, addressing edge cases for 90° and 270° rotations.
    https://github.com/user-attachments/assets/2562e9ba-e9d8-481d-b257-c59d58fe49ef

  5. Resolve Issues [Bug report] SetState will Reset ExtendedImage and clear the Crop State #712 and [Bug report] Crop Area Changed Unexpectedly  #713
    • Fixed bugs, ensuring improved functionality and reliability.

1. expose autoCenter method which is extracted from _startTimer()

2. add _lazy property managing to scale the image when needed
BUG: 1. when image is rotated with crop rect rotation, it only scale down image when needed, but will not scale up image to fit the layout viewport. Moreover, the image will getting smaller and smaller over repeatitive rotation. 2. the crop rect will changed unexpected when user drag it out of the image boundary.

SOLUTION: 1. Refine the scaleToFit method (previously, it only scale when the image oversize). 2. redesign updateCropRect method.
1. it can rotate the crop rect to 270 degree (rotate to left)

2. add transition on updateCropAspectRatio

3. improve widget compatibility: widget will always reset configuration and actions when parent widget call setState(), it violated flutter widget design pattern and makes widget design and management become more complicated. Thus, deprecate the force reset code.
@Peng-Qian Peng-Qian requested a review from zmtzawqlp as a code owner November 27, 2024 04:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant