Adjust video frame capture dimensions and button size for improved OCR alignment. Update related comments and increment version code to 4.72.792 to reflect these changes.
This commit is contained in:
@ -3461,9 +3461,8 @@ a.ms1-trad-link.btn-aide-trad{
|
||||
left:50%;
|
||||
top:50%;
|
||||
transform:translate(-50%,-50%);
|
||||
/* Guide un peu large : aligne sur la zone OCR (~70% x 40% du flux). */
|
||||
width:70%;
|
||||
height:40%;
|
||||
width:55%;
|
||||
height:30%;
|
||||
border:2px solid rgba(255,255,255,.95);
|
||||
border-radius:8px;
|
||||
box-shadow:0 0 0 100vmax rgba(0,0,0,.5);
|
||||
|
||||
@ -488,46 +488,25 @@
|
||||
});
|
||||
}
|
||||
|
||||
// MSIN-4401 — Un numero de dossard = tous les chiffres lus dans le cadre
|
||||
// (ex. OCR "5 2 1" ou "521" → "521"). Un chiffre seul = "5".
|
||||
function extractBibNumber(raw) {
|
||||
var matches = String(raw || '').match(/\d+/g);
|
||||
if (!matches || !matches.length) {
|
||||
var digits = String(raw || '').replace(/\D/g, '');
|
||||
if (digits.length < 1 || digits.length > BIB_MAX_LEN) {
|
||||
return '';
|
||||
}
|
||||
if (matches.length === 1) {
|
||||
var one = matches[0];
|
||||
return (one.length >= 1 && one.length <= BIB_MAX_LEN) ? one : '';
|
||||
}
|
||||
// OCR decoupe souvent un dossard manuscrit en chiffres isoles ("5" "2" "1").
|
||||
var allSingles = true;
|
||||
var i;
|
||||
for (i = 0; i < matches.length; i++) {
|
||||
if (matches[i].length !== 1) {
|
||||
allSingles = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (allSingles) {
|
||||
var joined = matches.join('');
|
||||
return (joined.length <= BIB_MAX_LEN) ? joined : '';
|
||||
}
|
||||
// Sinon : le groupe le plus long s'il domine clairement (evite 2 dossards).
|
||||
var sorted = matches.slice().sort(function (a, b) { return b.length - a.length; });
|
||||
if (sorted[0].length <= BIB_MAX_LEN && sorted[0].length > sorted[1].length) {
|
||||
return sorted[0];
|
||||
}
|
||||
return '';
|
||||
return digits;
|
||||
}
|
||||
|
||||
// MSIN-4401 — Crop central du flux video (comme avant le polish UI).
|
||||
// Zone un peu large pour un numero manuscrit entier dans le viseur.
|
||||
// Crop central du flux video — region du cadre blanc (~55% x 30%).
|
||||
function captureCenterFrame(videoEl) {
|
||||
if (!videoEl || !videoEl.videoWidth) {
|
||||
return null;
|
||||
}
|
||||
var w = videoEl.videoWidth;
|
||||
var h = videoEl.videoHeight;
|
||||
var cropW = Math.round(w * 0.7);
|
||||
var cropH = Math.round(h * 0.4);
|
||||
var cropW = Math.round(w * 0.55);
|
||||
var cropH = Math.round(h * 0.3);
|
||||
var sx = Math.round((w - cropW) / 2);
|
||||
var sy = Math.round((h - cropH) / 2);
|
||||
var canvas = document.createElement('canvas');
|
||||
|
||||
@ -1482,7 +1482,7 @@ function fxInscrGestionRenderBibScanBlock($strBibInputId, $strLangue) {
|
||||
echo '<div class="inscr-gestion-bib-scan-capture" role="button" tabindex="0">';
|
||||
echo '<div class="inscr-gestion-bib-scan-video"></div>';
|
||||
// Zone-cible centrale (eclaircie) : aligne le repere visuel sur la region
|
||||
// reellement lue par l'OCR (captureCenterFrame : ~70% largeur x 40% hauteur).
|
||||
// reellement lue par l'OCR (captureCenterFrame : ~55% largeur x 30% hauteur).
|
||||
echo '<div class="inscr-gestion-bib-scan-target" aria-hidden="true"></div>';
|
||||
// Pastille courte (fallback integre) — evite un long texte info qui masque le viseur.
|
||||
echo '<span class="inscr-gestion-bib-scan-capture-label">'
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
* Constantes *
|
||||
*
|
||||
**************/
|
||||
define('_VERSION_CODE', '4.72.791');
|
||||
define('_VERSION_CODE', '4.72.792');
|
||||
define('_DATE_CODE', '2026-07-13');
|
||||
//MSIN-4290
|
||||
define('QR_SECRET_KEY', 'ms1_qr_2026_cle_secrete_longue_et_fixe');
|
||||
|
||||
Reference in New Issue
Block a user