Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IO.binwrite error perhaps due to missing pattern match on {:ok, data} return? #4

Open
lasernite opened this issue Sep 21, 2020 · 0 comments

Comments

@lasernite
Copy link

lasernite commented Sep 21, 2020

When I run the basic usage like:

File.read("barcode.jpg") |> Zbar.scan()

I get an error like

** (FunctionClauseError) no function clause matching in IO.binwrite/2
    (elixir 1.10.4) lib/io.ex:275: IO.binwrite(#PID<0.628.0>, {:ok, <<255, 216, 255, 224, 0, 16, 74, 70, 73, 70, 0, 1, 1, 0, 0, 72, 0, 72, 0, 0, 255, 225, 0, 76, 69, 120, 105, 102, 0, 0, 77, 77, 0, 42, 0, 0, 0, 8, 0, 2, 1, 18, 0, 3, 0, 0, 0, 1, ...>>})
    (elixir 1.10.4) lib/file.ex:1417: File.open/3
    (elixir 1.10.4) lib/file.ex:1455: File.open!/3
    (zbar 0.2.1) lib/zbar.ex:38: Zbar.do_scan/2
    (elixir 1.10.4) lib/task/supervised.ex:90: Task.Supervised.invoke_mfa/2
    (elixir 1.10.4) lib/task/supervised.ex:35: Task.Supervised.reply/5
    (stdlib 3.13.1) proc_lib.erl:226: :proc_lib.init_p_do_apply/3

Looking through the recent commits and hypothesizing based on the binwrite error, perhaps the structure that needs to be passed to IO.binwrite should be (pid, symbols) instead of (pid, {:ok, symbols}) which is breaking the code in do_scan's return line 57 of zbar.ex?

Any thoughts appreciated! Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant