Giter Club home page Giter Club logo

zbar's People

Contributors

gregmefford avatar nekifirus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

zbar's Issues

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

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

Crash on jpeg with "Premature end of JPEG file"

It crashes if jpeg has "Premature end of JPEG file" and because of Task.async the caller app crashes too

13:43:01.184 [error] Task #PID<0.282.0> started from #PID<0.262.0> terminating
** (MatchError) no match of right hand side value: ["Premature"]
    (zbar) lib/zbar.ex:116: anonymous fn/2 in Zbar.parse_symbol/1
    (elixir) lib/enum.ex:1925: Enum."-reduce/3-lists^foldl/2-0-"/3
    (elixir) lib/enum.ex:1314: Enum."-map/2-lists^map/1-0-"/2
    (zbar) lib/zbar.ex:96: Zbar.format_result/1
    (elixir) lib/task/supervised.ex:89: Task.Supervised.do_apply/2
    (elixir) lib/task/supervised.ex:38: Task.Supervised.reply/5
    (stdlib) proc_lib.erl:249: :proc_lib.init_p_do_apply/3

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.