百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
R

rqrcode_png

> 编程语言
开源

使用 rQRCode 和 chunky_png 以纯 Ruby 语言生成 QR 码的 .png 图像。

182 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

使用 rQRCode 和 chunky_png 以纯 Ruby 语言生成 QR 码的 .png 图像。

rqrcode_png

Problem: You need to generate your own QR code images
Solution: rqrcode_png

Overview

rqrcode_png extends rqrcode, adding one simple method to instances of QRCode, #to_img. ChunkyPNG is used to generate the image itself in pure Ruby. As few assumptions are made as possible regarding the image itself.

Usage

ruby
require 'rqrcode_png'

qr = RQRCode::QRCode.new( 'my string to generate', :size => 4, :level => :h )
png = qr.to_img												# returns an instance of ChunkyPNG
png.resize(90, 90).save("really_cool_qr_image.png")

NOTE: For now, the :size of the QR code has to be 14 or less. Working on this.

Bundler

ruby
gem 'rqrcode_png'

Rails

With DragonFly

ruby
# app/models/product.rb
class Product  4, :level => :h ).to_img
@product.update_attribute :qr_code, qr_code_img.to_string
ruby
# app/controllers/products.rb
def show
	@product = Product.find(params[:id])
end
ruby
# app/views/products/show.html.erb

Contributing

  • Fork the project
  • Send a pull request
  • Don't touch the .gemspec, I'll do that when I release a new version

Copyright

MIT Licence (http://www.opensource.org/licenses/mit-license.html)

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Ruby

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言