Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
R

rqrcode_png

> 编程语言
Open source

Uses rQRCode and chunky_png to produce .png images of QR codes in pure Ruby.

182 stars0 likes0 views
WebsiteGitHub

About

Uses rQRCode and chunky_png to produce .png images of QR codes in pure Ruby.

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 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Ruby

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
Category编程语言
PricingOpen source

> Related tools

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