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
950 stars 242 forks source link

Image got from imagestream quality is low. #119

Closed sejun2 closed 1 year ago

sejun2 commented 2 years ago

Steps to Reproduce

     SizedBox(
              height: 500,
              child: CameraAwesome(

                ///Image_stream function
                  imagesStreamBuilder: (imageStream) {
                    imageStream!.listen((data) async {
                      if (streamMutex) {
                        print('imageStream working...');
                        streamMutex = false;
                        //logic here...
                        //await writeImageFile(data);

                        //add image data to stream
                        previewDataStreamController.add(data);

                        await Future.delayed(const Duration(milliseconds: 500),
                                () {
                              streamMutex = true;
                            }); //await time - 700 milliseconds
                      }
                    });
                  },
                  photoSize: _size,
                  sensor: _sensor,
                  captureMode: _captureMode),
            ),

....

     StreamBuilder(
                        builder: (context, snapshot) {
                          var result = snapshot.data;
                         //print('snapshot.data : $result');

                          if (!snapshot.hasData || snapshot.hasError) {
                            return const Text('something\'s wrong');
                          } else {
                            return Expanded(
                              child: //Image.file(result as File),
                              Image.memory(
                                result as Uint8List,
                              ),
                            );
                          }
                        },
                        stream: previewDataStream),
                  ],
                )),

Expected results

I expected origin quality of preview but it is not.

Actual results

Screenshot_1637549784 The image under the camerapreview is abnormal.

About your device

Brand Model OS
Apple iPhone X 13.6.1

Android /emulator/ API 31

ryuujo1573 commented 2 years ago

Is that about configs? photoSize: _size

g-apparence commented 1 year ago

This should be fixed with the reworked version #150

The new version will let you define the image stream definition and format.