Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Pylogmon committed Jul 27, 2023
1 parent 410aa2e commit a427260
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func recognizeTextHandler(request: VNRequest, error: Error?) {

}

func detectText(fileName : URL, lang : string) -> [CIFeature]? {
func detectText(fileName : URL, lang : String) -> [CIFeature]? {
if let ciImage = CIImage(contentsOf: fileName){
guard let img = convertCIImageToCGImage(inputImage: ciImage) else { return nil}

Expand All @@ -65,13 +65,12 @@ func detectText(fileName : URL, lang : string) -> [CIFeature]? {
return nil
}

supportedLanguages()
if CommandLine.argc < 2 {
print("Please provide an image path.")
} else {
let inputURL = URL(fileURLWithPath: CommandLine.arguments[1])
let language = CommandLine.arguments[2]
if let features = detectText(fileName : inputURL, lang : string), !features.isEmpty{}
if let features = detectText(fileName : inputURL, lang : String), !features.isEmpty{}
}

exit(EXIT_SUCCESS)

0 comments on commit a427260

Please sign in to comment.