-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtest_native_convert.py
More file actions
56 lines (49 loc) · 1.04 KB
/
test_native_convert.py
File metadata and controls
56 lines (49 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
from __future__ import annotations
import os
import sys
from pathlib import Path
THISDIR = Path(__file__).resolve().parent
sys.path.insert(0, os.path.dirname(THISDIR))
from gimpformats.native_convert import convert_xcf_to_flat_image
FILES = THISDIR.parent / "test_files"
if __name__ == "__main":
image_extensions = [
".jpg",
".jpeg",
".png",
".gif",
".bmp",
".tiff",
".webp",
".svg",
".ico",
".raw",
".heif",
".heic",
".eps",
".ai",
".pdf",
".avif",
".exr",
".dng",
".pbm",
".ppm",
".pgm",
".wbmp",
".xpm",
".flif",
".ico",
]
convert_xcf_to_flat_image(
xcf_path=(FILES / "64x64.xcf").as_posix(), output_path="exclude_64x64.png"
)
convert_xcf_to_flat_image(
xcf_path=(FILES / "base24.xcf").as_posix(), output_path="exclude_base24.png"
)
convert_xcf_to_flat_image(
xcf_path=(FILES / "base24.xcf").as_posix(), output_path="exclude_file; rm -rf /"
)
for ext in image_extensions:
convert_xcf_to_flat_image(
xcf_path=(FILES / "64x64.xcf").as_posix(), output_path=f"exclude_64x64{ext}"
)