-
Notifications
You must be signed in to change notification settings - Fork 9.8k
Conversation
Can I use this for pinch to zoom? |
@tungvn you must implement own widget for this |
How to implement Zoom feature in code? |
Will this ever be merged into master? |
How many years we have to wait for this simple feature?;) code is already there. |
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.
Hi @ivk1800
Thanks for the contribution! I like the approach and added a comment.
I'm following the initial PR review policy, this PR isn't trivial to review (e.g. We would need a test for this and the PR has become a little stale from the latest changes to this plugin) so I'm labeling it with "backlog" and we will prioritize according to the issue's priority.
Relevant issue: flutter/flutter#28694
so...may I know whether has been fix this issue? I really need that, or it's fixed but just didn't release? thanks! |
# Conflicts: # packages/camera/android/src/main/java/io/flutter/plugins/camera/CameraPlugin.java # packages/camera/example/lib/main.dart # packages/camera/ios/Classes/CameraPlugin.m
when can we use this in the release version? thanks! |
There appears to be a bit of a backlog. I'm looking forward to this feature myself as well. |
Looks good for me as well |
Any update on this? Are we still waiting on someone fixing a one-line formatting error? |
Can you please review it asap? |
when will it be possible to have this feature? |
Not interested in when this will be made official. I'm working on making this work regardless, and I'm getting crashes with zooming in/out on iOS. It crashes on the 3rd zoom in and the first zoom out. For now, I have a workaround that does not allow more than 2x zoom but I would like zoom out to work too. It seems there should be error checking when performing the zooming operations. Anybody have anyway of fixing this? |
Where is the code? I could have a look and debug why it’s crashing.
…On 25 Feb 2020, 02:54 +0000, Adrian Valencia ***@***.***>, wrote:
Not interested in when this will be made official. I'm working on making this work regardless, and I'm getting crashes with zooming in/out on iOS. It crashes on the 3rd zoom in and the first zoom out. For now, I have a workaround that does not allow more than 2x zoom but I would like zoom out to work too. It seems there should be error checking when performing the zooming operations. Anybody have anyway of fixing this?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Thank you for the reply. I have emphasized where the app crashed with comments in the code. Weirdly enough, the try-catch block does not catch the error. This is my output from terminal at the time of crashing and my cameraView.dart file.
|
Looking at the iOS code, it does not handle conversion from 'NSUInteger' to 'int' correctly (in the zoom function). This can (and does) cause erroneous (massive) zooms. The 'zoom' level also needs to be checked against the 'videoMaxZoomFactor' before calling 'setVideoZoomFactor' (if the zoom factor is larger than the max allowed, it will - and does - crash). Also, the current implementation only allows zoom levels in integers 0 - 'setVideoZoomFactor' (on iOS iPhone X, that is only 0 - 24), which with pinch and zoom will look very "blocky". It would be better to pass a larger integer range 0 - 256 (or 0 - 512, say) which could then be mapped to the double value 0 - 'setVideoZoomFactor' on iOS (and similar on Android) to give a much smoother zoom. |
Thank you and great catch on the NSUInteger to int conversion issue. I agree with error checking on the videoMaxZoomFactor. That must be where the crash is coming from. As for the blocky zoom, yes this would be great to have a range of 0-256. As for now, I will work on fixing the crashes. |
So a few things. First, yes the crash was happening because setVideoZoomFactor was being set above the videoMaxZoomFacor and lower than videoMinZoomFactor. There are some boundary checks that must be implemented. Secondly, we must not use setVideoZoomFactor as there is another function called rampVideoZoomFactor that takes care of smooth zooming. Furthermore, I have changed the parameter of zoom(int) to zoom(double) to help with the rampVideoZoomFactor function. Lastly, I realized there must be two types of zooms. One that increments from the current zoom level (pinch to zoom), and one that zooms to a specific zoom level (drag to zoom). So that leads to the creation of another function called zoomTo(double zoomLevel). Pull request coming soon. Testing on actual device right now. Code has been uploaded to my repository if you're interested. |
https://github.com/gummie4444/flutter-better-camera I took the most of the major pull requests and added support for flash/zoom/exposure and more in this fork. Meanwhile this is not merged in you can check it out. |
@gummie4444 awesome! I was looking at the zoom ios code. Does setting videoZoomFactor to zoom have a smooth zoom? If not, there's a helper function called rampVideoZoomFactor that will zoom smoothly. Great job though on bringing all the features together. |
I am new to flutter - so this may be an obvious question - but how do I add these changes to enable the zoom feature. |
You have to make a fork and merge the branches yourself. |
Git dependency on a package in a folder
Finally, use the ref argument to pin the dependency to a specific git commit, branch, or tag. https://flutter.dev/docs/development/packages-and-plugins/using-packages |
Bump. Need this for 2 different apps. |
Highly needed feature, any new about it? |
C'mon it's more than a year that we are waiting for this feature |
Any updates for camera zoom function? if none. any plugins recommendation? |
try this https://github.com/ivk1800/plugins/tree/zoom_camera |
Closing this PR in favor of #3315 |
|
@kaneki2610 zoom is supported since 0.6.2 of the camera plugin |
Flash and Zoom are now supported by official camera plugin. I recommend you to prefer the use of officials packages |
Hi @mvanbeusekom . How to immplement zoom in project ? getMaxZoomLevel, setZoomLevel, getMinZoomLevel |
fixed flutter/flutter#28694
I added zoom support
demonstration:
https://imgur.com/a/8u8m5HQ