browser/index.js overwrites window.screen

Aperta
#1,397 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
javascript
Ambito
frontend

Direzione di ricerca

Inizia leggendo browser/index.js e riproduci il problema con il pacchetto browser di Jimp 1.6.0 in un browser Windows, Android o iOS, confrontandolo con la versione 0.22.12. Il lavoro è completato quando Jimp continua a essere caricato e window.screen conserva le informazioni sullo schermo del browser invece di diventare la funzione screen di Jimp.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Expected Behavior

When using the browser/index.js, Jimp works fine however it overwrites window.screen and causes out application issues when needing the screen details to adjust the UX. I would expect the Jimp required global/window functions not to collide with standard objects. details of the screen standard here: https://developer.mozilla.org/en-US/docs/Web/API/Window/screen. We did not see this issue in 0.22.12 or earlier releases of Jimp.

Current Behavior

With Jimp 0.22.12, window.screen is:
Screen {
availHeight: 1366
availLeft: 0
availTop: 0
availWidth: 1024
colorDepth: 24
height: 1366
isExtended: true
onchange: null
orientation: ScreenOrientation {angle: 0, type: 'portrait-primary', onchange: null}
pixelDepth: 24
width: 1024
}

With Jimp 1.6.0 via browser/index.js:
function screen(e, t, i=1) {
e.a *= i;
const r = t.a + e.a - t.a * e.a
, n = e.r * e.a
, a = e.g * e.a
, o = e.b * e.a
, s = t.r * t.a
, l = t.g * t.a
, u = t.b * t.a;
return {
r: (n * t.a + s * e.a - n * s + n * (1 - t.a) + s * (1 - e.a)) / r,
g: (a * t.a + l * e.a - a * l + a * (1 - t.a) + l * (1 - e.a)) / r,
b: (o * t.a + u * e.a - o * u + o * (1 - t.a) + u * (1 - e.a)) / r,
a: r
}
}

Failure Information (for bugs)

The failure is the blocking of the screen information when using Jimp 1.6.0.

Steps to Reproduce

Lingua principale
TypeScript
Stelle
14.7k
Fork
777
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di jimp-dev/jimp

Tutte le issue di jimp-dev/jimp

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.