Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

browser/index.js overwrites window.screen

オープン
#1,397 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
javascript
領域
frontend

調査の方向性

まず browser/index.js を読み、Windows、Android、または iOS のブラウザーで Jimp 1.6.0 のブラウザーパッケージを使って問題を再現し、バージョン 0.22.12 と比較します。完了条件は、Jimp が引き続き読み込まれ、window.screen が Jimp の screen 関数になるのではなく、ブラウザーの画面情報を保持することです。

索引モデルが issue の本文から書いたものです。

説明

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

主要言語
TypeScript
スター
14.7k
フォーク
777
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

jimp-dev/jimp のほかの issue

jimp-dev/jimp の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。