Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Renderer options are overriden #16

Open
aivsev opened this issue Mar 13, 2013 · 6 comments
Open

Renderer options are overriden #16

aivsev opened this issue Mar 13, 2013 · 6 comments

Comments

@aivsev
Copy link

aivsev commented Mar 13, 2013

Hello. Generated barcodes are very big. I found an issue, that in Model/BarcodeService.php
at line 50 here is hardcoded options. It works perfectly, when i comment this line.
Could you fix this bundle?

https://github.com/phiamo/MopaBarcodeBundle/blob/master/Model/BarcodeService.php
Line 50: $rendererOptions = array('width' => 2233, 'height'=>649);

@kmdaniel
Copy link
Contributor

I have pushed a fix for this. See #17

@aivsev
Copy link
Author

aivsev commented Mar 20, 2013

Hello. Thanks for your answer. I generate barcodes via Twig. Like this:
{{ mopa_barcode_url(5, '7761134', {'barcodeOptions': {'barHeight' : 40, 'barThickWidth' : 2}}) }}

Your push didn't solve that problem. Barcodes is still 2233x649 size. Size is dynamic if I remove 50 and 51 lines and this is what i want to get. Is here any other way to make dynamic size barcodes?

@kmdaniel
Copy link
Contributor

I fixed the overwritten renderOptions eg. {{ mopa_barcode_url('code128', '123456789', {'barcodeOptions': {}, 'rendererOptions': {width:392, height:62}}) }} I didn't touch anything else.

@aivsev
Copy link
Author

aivsev commented Mar 21, 2013

I would like to have dynamic size images. I don't want to set an image size in rendererOptions.
It works perfectly if I remove 50 and 51 lines.

@kmdaniel
Copy link
Contributor

I'm not the maintainer of this bundle, I just forked it and made a pull request :)

@Nerjuz
Copy link

Nerjuz commented Jul 7, 2014

I found the solution without hardcode:
Just set width and height to zero.

'rendererOptions': {height:0,width:0}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants