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-flip/test/ drwxr-xr-x | |
| Viewing file: Select action/file-type: import { Jimp, mkJGD } from "@jimp/test-utils";
import configure from "@jimp/custom";
import flip from "../src";
import { expectToBeJGD } from "@jimp/test-utils/src";
const jimp = configure({ plugins: [flip] }, Jimp);
describe("Flipping plugin", () => {
it("can flip horizontally", async () => {
const src = await jimp.read(
mkJGD(
"AAAABBBB",
"AAABAAAB",
"ABABABAB",
"CCCCCCCC",
"CCCCCCCC",
"CCCCCCCC",
"AACCCCAA"
)
);
const result = src.flip(true, false);
expectToBeJGD(
result.getJGDSync(),
mkJGD(
"BBBBAAAA",
"BAAABAAA",
"BABABABA",
"CCCCCCCC",
"CCCCCCCC",
"CCCCCCCC",
"AACCCCAA"
)
);
});
it("can flip vertically", async () => {
const src = await jimp.read(
mkJGD(
"AAAABBBB",
"AAABAAAB",
"ABABABAB",
"CCCCCCCC",
"CCCCCCCC",
"CCCCCCCC",
"AACCCCAA"
)
);
const result = src.flip(false, true);
expectToBeJGD(
result.getJGDSync(),
mkJGD(
"AACCCCAA",
"CCCCCCCC",
"CCCCCCCC",
"CCCCCCCC",
"ABABABAB",
"AAABAAAB",
"AAAABBBB"
)
);
});
it("can flip both horizontally and vertically at once", async () => {
const src = await jimp.read(
mkJGD(
"AAAABBBB",
"AAABAAAB",
"ABABABAB",
"CCCCCCCC",
"CCCCCCCC",
"CCCCCCCC",
"AACCCCAA"
)
);
const result = src.flip(true, true);
expectToBeJGD(
result.getJGDSync(),
mkJGD(
"AACCCCAA",
"CCCCCCCC",
"CCCCCCCC",
"CCCCCCCC",
"BABABABA",
"BAAABAAA",
"BBBBAAAA"
)
);
});
});
|
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0229 ]-- |