Barcode generator: unpredictable whitespace padding around it depending on requested Width
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 35/100
Direzione di ricerca
Start with the ZXing.ImageSharp.BarcodeWriter call in the example, using CODE_39, Width = 400, Height = 400 and Margin = 0, and compare its output with the Width = 1 workaround. Find where the requested width is mapped onto the encoder's minimum module width, which the payload does not show, and make the extra space predictable. Done when a non-multiple width gives output whose bars fill the requested width with no unexplained horizontal padding.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
If you ask the barcode writer for an arbitrary width that isn't a multiple of the "default minimum" barcode width for that specific code, then you end up with unpredictable horizontal padding around the barcode.
an example:
public FileContentResult GithubExample()
{
var code = "123456789";
var barcodeWriter = new ZXing.ImageSharp.BarcodeWriter<Rgba32>
{
Format = BarcodeFormat.CODE_39,
Options = new EncodingOptions
{
Height = 400,
Width = 400,
Margin = 0
}
};
using var image = barcodeWriter.Write(code);;
using var stream = new MemoryStream();
var imageEncoder = new PngEncoder();
var mime = "image/png";
image.Save(stream, imageEncoder);
var bytes = stream.ToArray();
return File(bytes, mime);
}
result:
The workaround we currently have is to generate with Width = 1, then resize using ImageSharp after the fact. But it seems like something that ought to be handled by the generator anyway.
- Lingua principale
- C#
- Stelle
- 3.1k
- Fork
- 704
- Merge medio
- 13g 17h
- PR unite (30g)
- 2
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di micjahn/ZXing.Net
-
crop() overrides document "0 <= top <= Height"; should be top < Height like left < WidthForse già presa @hidingmyname l’ha presa 2 giorni fa. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
-
Difficoltà 3/5 Mezza giornata Idoneità per principianti 22/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 42/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 12/100
Tutte le issue di micjahn/ZXing.Net
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
bug elsa 3 prio low
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
elsa-workflows/elsa-core#9154 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
NethermindEth/nethermind#15452 ·
I maintainer di solito rispondono entro 1 giorno
-
kind:ux size:S
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
elsa-workflows/elsa-foundation#3563 ·
I maintainer di solito rispondono entro 1 giorno
-
请让 FPS 叠加层的字号大小可单独设置Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno