Skip to content
This repository was archived by the owner on Jan 19, 2024. It is now read-only.
This repository was archived by the owner on Jan 19, 2024. It is now read-only.

Fix for tiny sizes #29

@ScriptWarrior

Description

@ScriptWarrior

Hi!
Sry for my bad english.
I HAD an issue with tiny size bar (used PHP liblary):
Barcode::gd($image, $black, $col+150, $p*$k+120, 0, "code128", $bankAccount, 1.5, 10)

bars for width between 1 and 3 was a problem.

How do I fix that?

    // GD barcode renderer
    private static function digitToGDRenderer($gd, $color, $xi, $yi, $angle, $mw, $mh, $digit){
        $fn = function($points) use ($gd, $color) {
            $points[2]--; //////////////////////////////////////////// Added that (second X)
            $points[4]--; //////////////////////////////////////////// Added that (third X)
            //print_r($points);
            //exit();
            imagefilledpolygon($gd, $points, 4, $color);
        };
        return self::digitToRenderer($fn, $xi, $yi, $angle, $mw, $mh, $digit);
    }

After that its fine!
Tested with: Honeywell Voyager 1250g

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions