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

Bad height of Code128 and alike #26

Open
zEnterHacker opened this issue Nov 12, 2021 · 9 comments
Open

Bad height of Code128 and alike #26

zEnterHacker opened this issue Nov 12, 2021 · 9 comments

Comments

@zEnterHacker
Copy link

Hi,
First of all thanks for this super port. I'm using the initial version with great joy. Now I'm testing version 25.02.2020:

Comparing the latest version of Zint for Delphi with the previous one I find that a lot Code128 or alike are not taking correct dimensions.
They are cropped in height by some fixed factor. To illustrate please see below - screen dump taken form the supplied VCL demos.
<----- Left shows version: 25.02.2020 Girocode-Generator EPC-QR: -----> Right shows initial version:

image
The BoxModel does not seem to have changed - so I guess this is a small bug and happens for all 'simple' linestyled bar codes Code128 UPC .. etc?

Would be nice to have that fixed ;-)

Best regards
zEn

@landrix
Copy link
Owner

landrix commented Nov 12, 2021

Which initial version you mean? Do you have a link? Thanks

@zEnterHacker
Copy link
Author

Hi landrix ,

Well difficult to say. I simply can't remember where I got hold of this - but fear not the original zip file is attached to this post - it was originally downloaded on 2020-01-15 (from somewhere ??)

Zint-Barcode-Generator-for-Delphi-master.zip

I can do a simple file compare, and yes there are some changes made with respect to a 'Height' container in the new version, but I'm afraid I cannot see exactly how to rework the source to have the same functionality as the old version (attached) and f.i. the DATA MATRIX code seems to work as usual.
At the moment I have RAD Studio 10.3.3 & RAD Studio 11 - both shown the same behavior as indicated in my first post.

If You have further question - feel free to post back
Best regards
zEn

@landrix
Copy link
Owner

landrix commented Nov 12, 2021

Ok thanks, I will see

@zEnterHacker
Copy link
Author

Hi again,

I think it is this procedure that causes the problem (zint.pas):
procedure check_row_heights(symbol : zint_symbol);
It looks like codes without a pre-defined row_count (0) are forced to have 5 rows. This must be wrong because f.i. code128 becomes very narrow (1/5 in block height) and this will cause alignment problems for bar code readers. Skipping check_row_heights(symbol : zint_symbol) will cause normal height, but I guess the original C file includes this - and I'm not in a position to judge why.
It is also not clear why 5 has been chosen as row_count when the row_count is undefined. It could be that the row_count needs to be set in . f.i. zint_code128.pas? - but the lack of comments makes it pretty hard to guess ;-)

Best regards
zEn

@zEnterHacker
Copy link
Author

Any news on this issue?
I guess I can't be the only one having this scaling problem.

Best regards
zEn

@LukaszDemczuk
Copy link

Hi,
I have same problem. I'm using version from Commits on Apr 23, 2019 in my project.
Generated barcode looks like this:
image

Now I update Zint source to newest version and same code generate barcode like this:
image

@carloBarazzetta
Copy link

I suppose the error is into function ZBarcode_Encode of zint.pas:
old code:

  if error_number <= 5 then
    check_row_heights(symbol);

fixed code:

  if (error_number > 0) and (error_number <= 5) then
    check_row_heights(symbol);

Do you agree with this fix?
Thank you and my compliments for the great job!
Carlo

@landrix
Copy link
Owner

landrix commented Apr 29, 2023

Well difficult to say. I simply can't remember where I got hold of this - but fear not the original zip file is attached to this post - it was originally downloaded on 2020-01-15 (from somewhere ??)

Zint-Barcode-Generator-for-Delphi-master.zip

Both versions (initial and current) produce the same output for me. i don't have any scaling-problems. Delphi 11.3 and Surface Laptop with HighDPI 150%. So, whats different?

Screenshot 2023-04-29 094947

@carloBarazzetta
Copy link

I've made a new "clone", opened Zint-Barcode-Generator-for-Delphi\Demo\VCL\ZintTest.dproj with Delphi 11.3
Built, Run, Selected "Code 128..." this is my result:
image
Maybe you have some changes to your local folder: in the demo the imgResult component is Aligned alClient, as you can see in my screen-shot, but in your screen-shot it appears to be aligned to alNone... so we are using different source code.

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

4 participants