Git Product home page Git Product logo

Comments (10)

cluesque avatar cluesque commented on July 29, 2024 5

Coming to the party late. I'm finding it useful to generate png qr codes that are larger than the smallest possible, and having good luck using the xdim attribute:

barcode = Barby::QrCode.new("http://github.com/")
File.open('barcode3.png', 'w'){|f| f.write barcode.to_png(xdim: 5) }

from barby.

toretore avatar toretore commented on July 29, 2024

How do you know it ignores them? And where did you find out about them?

On Oct 1, 2013, at 11:51, Kasper Grubbe wrote:

I am using Barby 0.5.1 with chunky_png 1.2.8.

require 'RMagick'
include Magick
require 'barby'
require 'barby/barcode/code_128'
require 'barby/outputter/png_outputter'

def draw_barcode2(id, options = {})

barcodes_dir = FileUtils.mkdir_p("/Users/kasper/projects/barcoda/barcodes")

filepath = File.join(barcodes_dir, "#{id}")

filepath = "#{filepath}-rotated" if options[:rotate]

filepath = "#{filepath}.png"

barcode = Barby::Code128B.new(id)

File.open(File.join(filepath), 'w') do |f|

f.write barcode.to_image(:margin => 0,

:height => options[:height],

:width => options[:width])

end
end
I tehn run it as:

puts draw_barcode2('1-4-019', :width => 70, :height => 260, :rotate => true)
puts draw_barcode2('1-4-019', :width => 70, :height => 260, :rotate => false)
puts draw_barcode2 '1-4-021', :width => 280, :height => 70

puts draw_barcode2('1-4-020', :width => 70, :height => 260, :rotate => true)
puts draw_barcode2('1-4-020', :width => 70, :height => 260, :rotate => false)
puts draw_barcode2 '1-4-021', :width => 280, :height => 70

Retina:

puts draw_barcode2 '1-4-022', :width => 560, :height => 120

Reply to this email directly or view it on GitHub.

from barby.

jagregory avatar jagregory commented on July 29, 2024

I'm seeing this issue too.

barcode.to_png(height: 100, width: 600, margin: 5)

Gives me an image with a width of 364px.

from barby.

sandrods avatar sandrods commented on July 29, 2024

Having the same problem here. Generates 100px qrcodes, no matter the options informed

from barby.

toretore avatar toretore commented on July 29, 2024

There is no width option.

from barby.

sandrods avatar sandrods commented on July 29, 2024

I'm not using width option

require 'barby'
require 'barby/barcode/qr_code'
require 'barby/outputter/png_outputter'

barcode = Barby::QrCode.new("http://github.com/")
File.open('barcode3.png', 'w'){|f| f.write barcode.to_png(height: 300, margin: 5) }

The options are completely ignored

from barby.

toretore avatar toretore commented on July 29, 2024

You need to be more specific. What results are you expecting and what are you seeing?

from barby.

sandrods avatar sandrods commented on July 29, 2024

I expect a 300px height png, and I'm getting a 100px height png

Regards,

Sandro

On Monday, May 5, 2014, Tore Darell [email protected] wrote:

You need to be more specific. What results are you expecting and what are
you seeing?


Reply to this email directly or view it on GitHubhttps://github.com//issues/30#issuecomment-42207625
.

Sandro Duarte
Analista de Sistemas
STI/SADES
TRE-RS

from barby.

toretore avatar toretore commented on July 29, 2024

Ok; the height option isn't valid for 2D barcodes, for the same reason that
width isn't available for any barcode: It's not possible to impose those
dimensions on the result without corrupting it.

On Tue, May 6, 2014 at 11:32 PM, Sandro Duarte [email protected]:

I expect a 300px height png, and I'm getting a 100px height png

Regards,

Sandro

On Monday, May 5, 2014, Tore Darell [email protected] wrote:

You need to be more specific. What results are you expecting and what
are
you seeing?


Reply to this email directly or view it on GitHub<
https://github.com/toretore/barby/issues/30#issuecomment-42207625>
.

Sandro Duarte
Analista de Sistemas
STI/SADES
TRE-RS


Reply to this email directly or view it on GitHubhttps://github.com//issues/30#issuecomment-42362037
.

from barby.

vknightbd avatar vknightbd commented on July 29, 2024

as a response to cluesque's comment, going smaller is not possible, xdim: 1, is the default and as small as you can go using the png_outputter

from barby.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.