simplify getting of max texture size for atlas, improve ffmpeg missing popup messages

This commit is contained in:
csd4ni3l
2025-07-21 23:50:48 +02:00
parent 9d7645ae65
commit 13742b8a0c
2 changed files with 6 additions and 9 deletions

View File

@@ -13,8 +13,8 @@ class FFmpegMissing(arcade.gui.UIView):
arcade.gui.UIMessageBox( arcade.gui.UIMessageBox(
width=self.window.width / 2, width=self.window.width / 2,
height=self.window.height / 2, height=self.window.height / 2,
title="FFmpeg Missing", title="Third-party FFmpeg Missing",
message_text="FFmpeg has not been found but is required for this application.", message_text="FFmpeg is a third party software that is required for this application to work. It needs to be downloaded with libavcodec (and) shared libraries included. We provide a basic install script for Windows that might or might not work. For other operating systems, install from the package manager to make sure it is in PATH.",
buttons=("Exit", "Install") buttons=("Exit", "Install")
) )
) )
@@ -28,7 +28,7 @@ class FFmpegMissing(arcade.gui.UIView):
system = platform.system() system = platform.system()
if system == "Linux" or system == "Darwin": if system == "Linux" or system == "Darwin":
msgbox = self.add_widget(arcade.gui.UIMessageBox(message_text="You are on a Linux or Darwin based OS. You need to install FFmpeg, and libavcodec shared libraries from your package manager so it is in PATH.", width=self.window.width / 2, height=self.window.height / 2)) msgbox = self.add_widget(arcade.gui.UIMessageBox(message_text="You are on a Linux or Darwin based OS. You need to install FFmpeg and libavcodec shared libraries from your package manager to make sure it is in PATH.", width=self.window.width / 2, height=self.window.height / 2))
msgbox.on_action = lambda: sys.exit() msgbox.on_action = lambda: sys.exit()
return return
@@ -46,4 +46,4 @@ class FFmpegMissing(arcade.gui.UIView):
logging.debug("Failed to install FFmpeg via winget:", e) logging.debug("Failed to install FFmpeg via winget:", e)
else: else:
self.add_widget(arcade.gui.UIMessageBox(message_text="Your OS is unsupported by this script. You are probably on some kind of BSD system. Please install FFmpeg and libavcodec shared libraries from your package manager so it is in PATH.", width=self.window.width / 2, height=self.window.height / 2)) self.add_widget(arcade.gui.UIMessageBox(message_text="Your OS is unsupported by this script. You are probably on some kind of BSD system. Please install FFmpeg and libavcodec shared libraries from your package manager to make sure it is in PATH.", width=self.window.width / 2, height=self.window.height / 2))

7
run.py
View File

@@ -7,13 +7,10 @@ os.environ['SSL_CERT_FILE'] = certifi.where() # Fix SSL not working and download
import pyglet import pyglet
pyglet.options.debug_gl = False pyglet.options.debug_gl = False
max_texture_size = pyglet.image.get_max_texture_size()
import logging, datetime, json, sys, arcade import logging, datetime, json, sys, arcade
window = pyglet.window.Window(visible=False, width=1, height=1) arcade.ArcadeContext.atlas_size = (max_texture_size, max_texture_size)
max_tex_size = pyglet.gl.GLint()
pyglet.gl.glGetIntegerv(pyglet.gl.GL_MAX_TEXTURE_SIZE, max_tex_size)
arcade.ArcadeContext.atlas_size = (max_tex_size.value, max_tex_size.value)
window.close()
from utils.utils import get_closest_resolution, print_debug_info, on_exception from utils.utils import get_closest_resolution, print_debug_info, on_exception
from utils.acoustid_metadata import get_fpcalc_path from utils.acoustid_metadata import get_fpcalc_path