!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 

uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 

uid=33(www-data) gid=33(www-data) groups=33(www-data) 

Safe-mode: OFF (not secure)

/var/www/html/invoice_pdf/node_modules/@jimp/plugin-cover/test/   drwxr-xr-x
Free 13.31 GB of 57.97 GB (22.96%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     cover.test.js (4.1 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
import { Jimp, mkJGD, hasOwnProp } from "@jimp/test-utils";
import configure from "@jimp/custom";
import crop from "@jimp/plugin-crop";
import scale from "@jimp/plugin-scale";
import resize from "@jimp/plugin-resize";

import cover from "../src";
import { expectToBeJGD } from "@jimp/test-utils/src";

const jimp = configure({ plugins: [resize, scale, crop, cover] }, Jimp);

describe("All align combinations for cover", () => {
  const verticalJGD = mkJGD(
    "▴▴▴▴▸▸▸▸",
    "▴▴▴▴▸▸▸▸",
    "▴▴▴▴▸▸▸▸",
    "▴▴▴▴▸▸▸▸",
    "▴▴▴▴▸▸▸▸",
    "▴▴▴▴▸▸▸▸",
    "▾▾▾▾◆◆◆◆",
    "▾▾▾▾◆◆◆◆",
    "▾▾▾▾◆◆◆◆",
    "▾▾▾▾◆◆◆◆",
    "▾▾▾▾◆◆◆◆",
    "▾▾▾▾◆◆◆◆"
  );

  const horizontalJGD = mkJGD(
    "▴▴▴▴▴▴▸▸▸▸▸▸",
    "▴▴▴▴▴▴▸▸▸▸▸▸",
    "▴▴▴▴▴▴▸▸▸▸▸▸",
    "▴▴▴▴▴▴▸▸▸▸▸▸",
    "▾▾▾▾▾▾◆◆◆◆◆◆",
    "▾▾▾▾▾▾◆◆◆◆◆◆",
    "▾▾▾▾▾▾◆◆◆◆◆◆",
    "▾▾▾▾▾▾◆◆◆◆◆◆"
  );

  let vertical;
  let horizontal; // stores the Jimp instances of the JGD images above.

  before((done) => {
    const img1 = jimp.read(verticalJGD);
    const img2 = jimp.read(horizontalJGD);
    Promise.all([img1, img2])
      .then((images) => {
        vertical = images[0];
        horizontal = images[1];
        done();
      })
      .catch(done);
  });

  const tests = {}; // Stores the expected result for each alignment combination.
  tests["LEFT TOP"] = {
    cover: {
      verti: mkJGD("▴▴▸▸", "▴▴▸▸", "▴▴▸▸", "▾▾◆◆"),
      horiz: mkJGD("▴▴▴▸", "▴▴▴▸", "▾▾▾◆", "▾▾▾◆"),
    },
  };
  tests["CENTER TOP"] = {
    cover: {
      verti: mkJGD("▴▴▸▸", "▴▴▸▸", "▴▴▸▸", "▾▾◆◆"),
      horiz: mkJGD("▴▴▸▸", "▴▴▸▸", "▾▾◆◆", "▾▾◆◆"),
    },
  };
  tests["RIGHT TOP"] = {
    cover: {
      verti: mkJGD("▴▴▸▸", "▴▴▸▸", "▴▴▸▸", "▾▾◆◆"),
      horiz: mkJGD("▴▸▸▸", "▴▸▸▸", "▾◆◆◆", "▾◆◆◆"),
    },
  };

  tests["LEFT MIDDLE"] = {
    cover: {
      verti: mkJGD("▴▴▸▸", "▴▴▸▸", "▾▾◆◆", "▾▾◆◆"),
      horiz: mkJGD("▴▴▴▸", "▴▴▴▸", "▾▾▾◆", "▾▾▾◆"),
    },
  };
  tests["CENTER MIDDLE"] = {
    cover: {
      verti: mkJGD("▴▴▸▸", "▴▴▸▸", "▾▾◆◆", "▾▾◆◆"),
      horiz: mkJGD("▴▴▸▸", "▴▴▸▸", "▾▾◆◆", "▾▾◆◆"),
    },
  };
  tests["RIGHT MIDDLE"] = {
    cover: {
      verti: mkJGD("▴▴▸▸", "▴▴▸▸", "▾▾◆◆", "▾▾◆◆"),
      horiz: mkJGD("▴▸▸▸", "▴▸▸▸", "▾◆◆◆", "▾◆◆◆"),
    },
  };

  tests["LEFT BOTTOM"] = {
    cover: {
      verti: mkJGD("▴▴▸▸", "▾▾◆◆", "▾▾◆◆", "▾▾◆◆"),
      horiz: mkJGD("▴▴▴▸", "▴▴▴▸", "▾▾▾◆", "▾▾▾◆"),
    },
  };
  tests["CENTER BOTTOM"] = {
    cover: {
      verti: mkJGD("▴▴▸▸", "▾▾◆◆", "▾▾◆◆", "▾▾◆◆"),
      horiz: mkJGD("▴▴▸▸", "▴▴▸▸", "▾▾◆◆", "▾▾◆◆"),
    },
  };
  tests["RIGHT BOTTOM"] = {
    cover: {
      verti: mkJGD("▴▴▸▸", "▾▾◆◆", "▾▾◆◆", "▾▾◆◆"),
      horiz: mkJGD("▴▸▸▸", "▴▸▸▸", "▾◆◆◆", "▾◆◆◆"),
    },
  };

  function runAlignTest(align) {
    const jgdCoverV = tests[align].cover.verti;
    const jgdCoverH = tests[align].cover.horiz;
    let a = align.split(" ");
    a = Jimp["HORIZONTAL_ALIGN_" + a[0]] | Jimp["VERTICAL_ALIGN_" + a[1]];
    it("cover aligned to " + align, () => {
      expectToBeJGD(vertical.clone().cover(4, 4, a).getJGDSync(), jgdCoverV);
      expectToBeJGD(horizontal.clone().cover(4, 4, a).getJGDSync(), jgdCoverH);
    });
  }

  for (const align in tests) if (hasOwnProp(tests, align)) runAlignTest(align);
});

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.057 ]--