ricnaaru / adv_camera

Advanced Camera for Flutter
BSD 3-Clause "New" or "Revised" License
54 stars 35 forks source link

How get the image data without direct save to disk. #24

Closed PandaKM closed 4 years ago

PandaKM commented 4 years ago

hi , richardothayeb. with me the adv_camera is very helpful. I want to be able to get data directly instead of saving it to disk first, which can better optimize the process. I tried to change your source code, but I failed because of lack of ability. If you don't mind, can you provide some guidance, or provide a method to get the picture data directly for manual processing. Thanks♪(・ω・)ノ

ricnaaru commented 4 years ago

on android, camera.takePicture(null, null, jpegCallback); the callback will have byte[] which is bytes array, and on IOS stillImageOutput.captureStillImageAsynchronously(from: videoConnection) closure will have imageDataSampleBuffer which can be used to let imageData

AVCaptureStillImageOutput.jpegStillImageNSDataRepresentation(imageDataSampleBuffer) which is byte array too

PandaKM commented 4 years ago

Thank you for your answer. I'm trying.