Fix hermes_privat_v112 crop to match the v1.1.2 layout - #23
Open
MaxWinterstein wants to merge 1 commit into
Open
Fix hermes_privat_v112 crop to match the v1.1.2 layout#23MaxWinterstein wants to merge 1 commit into
hermes_privat_v112 crop to match the v1.1.2 layout#23MaxWinterstein wants to merge 1 commit into
Conversation
The v1.1.2 bump only renamed the entry, so the rectangles still described the v1.1.1 label. Measured against a real v1.1.2 label, the title crop missed the top 15px of the glyphs, `Zahlungscode` cut 5px off "bezahlt", `Empfänger Land` cut 2px, and the `Sendungsnummer` barcode lost 46px of bar length. Title and divider were also drawn flush to the canvas edge instead of inside the 12px safety zone used elsewhere. Also adds the first sample for this label version and enables its README links; the previous sample image still showed the old v1.0.2 layout.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
hermes-privat-v112was created in 85dec85 by renaminghermesPrivatV111; no coordinate was changed. Measured against a real v1.1.2 label, several source rectangles miss content:The title was also drawn at
dst y = 0and the divider ran fromy 0toy 696, flush with the canvas edge instead of inside the 12 px (1 mm) zonecrop.jsmarks in debug mode.Resulting ink in the 1642×696 output canvas:
y 0..25(26 px of 41 px visible)y 15..55x ..1639x ..1637, "bezahlt" completey 380..675(296 px)y 338..679(342 px)y 0..695y 12..683Also included: the first sample for this label version (
samples/hermes/hermes_privat.png/.pdf, generated with the app itself) and the two README links enabled. The previous sample image still showed the old v1.0.2 "Privatservice" layout, which is probably why it was commented out.GewichtswarnungandZusatz EUare left untouched — my label does not contain them, so I could not measure them.How the numbers were measured: the page was rendered with the app's own pdf.js at scale 4, every
drawImagecall recorded through aProxyon the 2D context, and the real ink bounding boxes measured instead of eyeballing coordinates. The label's fonts are embedded, so the values do not depend on the renderer.The anonymised label I measured against sits on a side branch of my fork, in case you want to re-check: addresses, both shipment IDs, barcode, both QR codes and the tracking link annotation are replaced, and it still reproduces the clipping.
Prepared with AI assistance (Claude Code) — analysis, measurements and patch come from an agent session.