2018年4月8日 星期日

Ez ZBar -- QR/Bar Code Decoder Patch


Sometimes, we might need to acquire the information from the QR/bar code on the screen, e.g. some streaming videos made by Chinese teams. Due to some reason I don't quite understand, QR code is extremely popular in China, which has already penetrated the whole life of Chinese (in China).

However, scanning the QR code on the screen is not very easy if you don't want to use the smart phone. I know it sounds ridiculous, but it's true.... ZBar is a command line tool to decode QR/bar codes, but not so convenient to use, so I write Ez ZBar to automatize the scanning process.

Of course, if you are a light-weight user for QR/bar code scanning, the online tool such as Inlite Online Reader might be a better choice for you.

有時,我們會有擷取螢幕上 QR/bar 碼內容的需求 (比如說看中國團隊製作的網路影片)。基於某些我不清楚的理由,QR 碼 (或稱二維碼) 在中國異常地火爆,不僅人人使用,甚至可說是時刻都在使用,已經成為他們生活的一部分。

然而,如果不使用智慧型手機,掃描螢幕上的二維碼居然不是很容易。我知道這聽起來很荒謬,但這是事實。ZBar 是一個命令列工具,用來解碼各式條碼及二維碼,但實際使用時不是很方便,所以我寫了一個 Ez ZBar 去自動化整個掃碼過程。

當然,如果你只是偶爾掃描一次的輕量級用戶,那直接擷圖使用線上工具如 Inlite Online Reader 就可以了,不用安裝軟體。


How to install

1. Use Homebrew to install ZBar [1][2].
 brew install zbar
2. Download and unarchive Ez ZBar, and then Put Ez ZBar to anywhere you could launch it easily.


1. 使用 Homebrew 去安裝 ZBar 命令列工具 [1][2].
brew install zbar
2. 下載 Ez ZBar 並解壓縮,然後把 Ez ZBar 放在任意方便啟動的地方


How to use

1. Launch Ez ZBar, the mouse cursor will become "cross" sign, ready for screen capture. And then select the area of the QR/bar code, a pop-up window will show you the information inside the code.

1. 啟動 Ez ZBar,滑鼠指標會變成螢幕擷圖的十字狀。選定二維碼或條碼的區域,放手之後即會彈出一個視窗把該條碼的內容秀出來,可選擇把內容複製到剪貼版裡。


2. Ez ZBar supports more than one codes in the screen capture or image as well.

2. Ez ZBar 也支援同一圖片中多於一個二維碼或條碼,可選擇複製一個碼的內容或全部複製。


2-a. "Copy one"

2-a. "複製一個"
2-b. "Copy all": copy the information of all codes with two separation signs, which could be column or row data in the spreadsheet.

2-b. "全部複製": 可把複製的全部內容用 "NewLine" 或 "Tab" 符號分開,複製進試算表的時候呈現 "行" 或 "列" 的資料排列。


3. Ez ZBar is also a droplet, so you can drag and drop the image file of your code on it.

3. Ez ZBar 也是一個 droplet,所以可以把二維碼或條碼的圖片拖到它上面讓它解碼。


4. Because of the droplet characteristic, you can make a service/right-click menu item via Automator. (In my case, I don't get the image file of codes usually, so I seldom use the droplet feature)

4. 由於 droplet 的特性,也可以把 Ez ZBar 做成 Automator 服務 (或稱右鍵選單),但我一般不儲存二維碼或條碼的圖片,所以很少這樣使用就是了。


=========

If any bug was found, please don't hesitate to let me know by email, any suggestion is appreciated.

20181110 Update v1.1: Fix the error message after cancelling the screenshot, as below:




Notes
1. Homebrew is a port system for free/open softwares, just like the package manager on Linux, e.g. "apt-get" for Ubuntu Linux. Many popular Linux distros contain the GUI version of the package manager such as Mac App store, but there is nothing like that for Homebrew, so we need to use it with command line. Homebrew had some competitors like MacPorts and Fink, but these two become not-so-popular in past few years.

1. Homebrew 是 macOS 上移植自由軟體的系統之一,目的是編譯自由軟體的原始碼以移植到 macOS 上,最後的結果有點類似 Linux 的套件管理庫,比如說 Ubuntu 系的 Linux 發行版都可以使用 "apt-get" 指令去安裝軟體,就類似 Homebrew 的 "brew install"。很多熱門的 Linux 發行版都包含套件管理庫的圖形介面,類似 Mac App store,但是 Homebrew 至今還沒有圖形介面。在 macOS 上 還有其他類似 Homebrew 的套件管理軟體,例如 MacPortFink,但是近年來都比不上 Homebrew 的熱門程度。

2. A featured ability of Homebrew is to allow users to install softwares without administrator permission (sudo + administrator's password), but you still need to log in with administrator account. If you don't use the administrator account for daily use (such as me), use the command "su - [administrator account]" to change the user temporarily. (see my old blog article)

2. Homebrew 標榜的一個特點是允許使用者在安裝軟體時不需使用 sudo,但仍然需要用管理者的帳號登入。如果你像我一樣平時不使用管理者帳號,可以使用 su - [管理者帳號] 去暫時地更改登入的使用者為管理者,然後再使用 brew stall 安裝軟體。(請見我的舊文)

沒有留言:

張貼留言