Apparence-io / CamerAwesome

📸 Embedding a camera experience within your own app shouldn't be that hard. A flutter plugin to integrate awesome Android / iOS camera experience.
https://ApparenceKit.dev
MIT License
949 stars 240 forks source link

Camera Preview Size of an ID Card #161

Closed blakewood84 closed 1 year ago

blakewood84 commented 1 year ago

Hey guys I'd love to use your package but I have a problem with the preview. When I first load the preview like the example:

Widget buildSizedScreenCamera() {
    return Positioned(
      top: 0,
      left: 0,
      bottom: 0,
      right: 0,
      child: Container(
        color: Colors.black,
        child: Center(
          child: Container(
            height: 300,
            width: MediaQuery.of(context).size.width,
            child: CameraAwesome(
              onPermissionsResult: _onPermissionsResult,
              selectDefaultSize: (availableSizes) {
                this._availableSizes = availableSizes;
                return availableSizes[0];
              },
              captureMode: _captureMode,
              photoSize: _photoSize,
              sensor: _sensor,
              fitted: true,
              switchFlashMode: _switchFlash,
              zoom: _zoomNotifier,
              onOrientationChanged: _onOrientationChange,
            ),
          ),
        ),
      ),
    );

I fortunately get a preview size that is this shape, which has a taller height and a short width:

Screen Shot 2022-12-10 at 4 45 02 PM

I'd like it to be this shape, which is wider with a short height:

Screen Shot 2022-12-10 at 4 45 13 PM

And hopefully to make double sense, the preview size i'm talking about is whatever image the CameraAwesome widget is showing me from the camera before taking a picture.

When I wrap the Camera in an Expanded this does nothing either to stretch it out. Currently for the project I'm working on I am taking a picture of a photo ID of a customer. The dimensions needed for this are: 3.375" x 2.125" (inches) which might look like Size(524, 304).

Thanks so much for any response.

I test on Android and MacOS

g-apparence commented 1 year ago

Yes we have that in mind. Currently changing aspect ratio works for taking picture / video. We are thinking about another option to stretch the preview.

If I'm correct you are searching a way to crop the preview with custom values.

Another possibility now is :

blakewood84 commented 1 year ago

Hey at @g-apparence , thanks for the response. No I didn't know there was a custom builder, I had not seen this in documentation anywhere. How do I access documentation for this to implement? Thanks so much!

g-apparence commented 1 year ago

Here is the link for the documentation https://docs.page/Apparence-io/camera_awesome/