npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

jb2

v1.0.6

Published

easyjbig2,jb2 file show

Downloads

18

Readme

easyJBIG2show

an easy JBIG2 file web show
csdn地址 git地址

一、背景

最近无意中接触到了一个二维码图片,该图片格式是jb2格式。翻阅资料发现JBIG标准最初在1993年发布,在当时被广泛应用于传真机和文档扫描仪等设备中。JBIG采用了一种自适应二进制编码算法,能够有效地压缩包含大量文本和线条等的二值图像。
随着技术的进步和需求的增加,JBIG2标准于2000年发布,对于从传真到高分辨率彩色扫描文档等各种类型的图像进行无损压缩提供了更好的性能和灵活性。JBIG2引入了更先进的编码技术,如上下文自适应算法和模板匹配,能够进一步减小文件大小,提高压缩率。 JBIG2标准的发布促使了许多设备和应用程序的支持。它被广泛用于电子归档、数字图书馆、OCR(光学字符识别)和文档管理等领域,以实现高效的文档扫描和存储。 总的来说,JBIG2作为一种专门针对二值图像的无损压缩技术,为高质量的文档图像处理提供了重要的工具和方法,并在数字化文档管理和传输中发挥了重要的作用。
由于web端的图片不能对jb2文件格式正确展示,由此想到需要转换。

二、前人经验

网络资源很少,这也是为什么在这里分享的原因。虽然很少,但还是找了些蛛丝马迹,指向了mozilla/pdf.js。
在这里我把需要使用的所有js都整合到这里

三、VUE 使用方法

  npm i jb2


<template>
<div class="hello">
<h1>{{ msg }}</h1>
<input type="file" @change="handleFileSelect">
<img v-bind:src="imageSrc" />
</div>
</template>

<script>
import JB2 from "jb2"

export default {
name: 'HelloWorld',
data() {
return {
  msg: 'Welcome to Your Vue.js App',
  imageSrc: ''
}
},
methods: {
handleFileSelect(event) {
  var files = event.target.files; // 获取选择的文件数组
  var file = files[0]; // 获取第一个文件

  var jb2 = new JB2();
  var  ret=jb2.jb2Image(file,'png');
  ret.then((image) => {
    this.imageSrc = image.src;
  });

}
}
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h1,
h2 {
font-weight: normal;
}

ul {
list-style-type: none;
padding: 0;
}

li {
display: inline-block;
margin: 0 10px;
}

a {
color: #42b983;
}</style>