-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
53 lines (37 loc) · 1.24 KB
/
main.py
File metadata and controls
53 lines (37 loc) · 1.24 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
"""GIF Forge - Video to GIF Converter
Entry point for the application.
"""
import os
import sys
from PySide6 import QtWidgets, QtCore
def _apply_high_dpi_attributes() -> None:
"""Configure high-DPI settings for Qt6"""
# Qt6 enables high-DPI scaling by default
return None
def locate_ff_binaries() -> dict:
"""
Locate FFmpeg binaries in the same directory as the application.
Returns:
dict: Paths to ffmpeg, ffprobe, and ffplay executables
"""
base_dir = os.path.dirname(os.path.abspath(sys.argv[0]))
suffix = ".exe" if os.name == "nt" else ""
return {
"ffmpeg": os.path.join(base_dir, f"ffmpeg{suffix}"),
"ffprobe": os.path.join(base_dir, f"ffprobe{suffix}"),
"ffplay": os.path.join(base_dir, f"ffplay{suffix}"),
}
def main() -> int:
"""Main entry point"""
_apply_high_dpi_attributes()
app = QtWidgets.QApplication(sys.argv)
app.setOrganizationName("GifForge")
app.setApplicationName("GIF Forge")
from gif_converter.ui.main_window import MainWindow
ff_bins = locate_ff_binaries()
window = MainWindow(ff_bins=ff_bins)
window.resize(1400, 900)
window.show()
return app.exec()
if __name__ == "__main__":
raise SystemExit(main())