Toggle navigation
Toggle navigation
This project
Loading...
Sign in
flutter_package
/
mobile_scanner
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Navaron Bracke
2024-09-04 10:02:57 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
fa23d7dd28ae20fd1ed15381309e6a4cf17ff240
fa23d7dd
1 parent
48d83fee
clean up some redundant statements in ios/MobileScanner.swift
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
13 deletions
ios/Classes/MobileScanner.swift
ios/Classes/MobileScanner.swift
View file @
fa23d7d
...
...
@@ -127,7 +127,6 @@ public class MobileScanner: NSObject, AVCaptureVideoDataOutputSampleBufferDelega
/// Gets called when a new image is added to the buffer
public
func
captureOutput
(
_
output
:
AVCaptureOutput
,
didOutput
sampleBuffer
:
CMSampleBuffer
,
from
connection
:
AVCaptureConnection
)
{
guard
let
imageBuffer
=
CMSampleBufferGetImageBuffer
(
sampleBuffer
)
else
{
print
(
"Failed to get image buffer from sample buffer."
)
return
}
latestBuffer
=
imageBuffer
...
...
@@ -160,7 +159,9 @@ public class MobileScanner: NSObject, AVCaptureVideoDataOutputSampleBufferDelega
if
(
error
==
nil
&&
barcodesString
!=
nil
&&
newScannedBarcodes
!=
nil
&&
barcodesString
!.
elementsEqual
(
newScannedBarcodes
!
))
{
return
}
else
if
(
newScannedBarcodes
?
.
isEmpty
==
false
)
{
}
if
(
newScannedBarcodes
?
.
isEmpty
==
false
)
{
barcodesString
=
newScannedBarcodes
}
}
...
...
@@ -446,17 +447,6 @@ public class MobileScanner: NSObject, AVCaptureVideoDataOutputSampleBufferDelega
var
barcodesString
:
Array
<
String
?
>
?
// /// Convert image buffer to jpeg
// private func ciImageToJpeg(ciImage: CIImage) -> Data {
//
// // let ciImage = CIImage(cvPixelBuffer: latestBuffer)
// let context:CIContext = CIContext.init(options: nil)
// let cgImage:CGImage = context.createCGImage(ciImage, from: ciImage.extent)!
// let uiImage:UIImage = UIImage(cgImage: cgImage, scale: 1, orientation: UIImage.Orientation.up)
//
// return uiImage.jpegData(compressionQuality: 0.8)!
// }
/// Rotates images accordingly
func
imageOrientation
(
deviceOrientation
:
UIDeviceOrientation
,
...
...
Please
register
or
login
to post a comment