欧美一区二区三区老妇人-欧美做爰猛烈大尺度电-99久久夜色精品国产亚洲a-亚洲福利视频一区二区

node解析圖片二維碼的內(nèi)容代碼實例-創(chuàng)新互聯(lián)

這篇文章主要介紹了node 解析圖片二維碼的內(nèi)容代碼實例,文中通過示例代碼介紹的非常詳細,對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友可以參考下

十年的沿灘網(wǎng)站建設(shè)經(jīng)驗,針對設(shè)計、前端、開發(fā)、售后、文案、推廣等六對一服務(wù),響應(yīng)快,48小時及時工作處理。營銷型網(wǎng)站建設(shè)的優(yōu)勢是能夠根據(jù)用戶設(shè)備顯示端的尺寸不同,自動調(diào)整沿灘建站的顯示方式,使網(wǎng)站能夠適用不同顯示終端,在瀏覽器中調(diào)整網(wǎng)站的寬度,無論在任何一種瀏覽器上瀏覽網(wǎng)站,都能展現(xiàn)優(yōu)雅布局與設(shè)計,從而大程度地提升瀏覽體驗。創(chuàng)新互聯(lián)從事“沿灘網(wǎng)站設(shè)計”,“沿灘網(wǎng)站推廣”以來,每個客戶項目都認真落實執(zhí)行。
const {readFile, readFileSync} = require('fs');
const decodeImage = require('jimp').read;
const qrcodeReader = require('qrcode-reader');
const path = require("path");
var p = path.resolve(__dirname,"data/qrcode2.jpg"); 
readFile(p,function(err,fileBuffer){
  if(err){
    throw new Error(err);
    return ;
  } 
  decodeImage(fileBuffer,function(err,image){
    if(err){
      throw new Error(err);
      return ;
    }
    let decodeQR = new qrcodeReader();
    decodeQR.callback = function(errorWhenDecodeQR, result) {
      if (errorWhenDecodeQR) {
        throw new Error(errorWhenDecodeQR)
        return;
      }
      if (!result){
        console.log("gone with wind");
      }else{
        console.log(result.result); //結(jié)果
      }      
     };    
    decodeQR.decode(image.bitmap);      
  });  
})

分享文章:node解析圖片二維碼的內(nèi)容代碼實例-創(chuàng)新互聯(lián)
網(wǎng)站網(wǎng)址:http://chinadenli.net/article14/dsgsde.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供定制開發(fā)、網(wǎng)站內(nèi)鏈做網(wǎng)站、網(wǎng)站導(dǎo)航App設(shè)計、標(biāo)簽優(yōu)化

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

小程序開發(fā)