Skip to content

Commit

Permalink
fix: refactoring + error handling
Browse files Browse the repository at this point in the history
Refs: #69
  • Loading branch information
grigoriev committed Sep 20, 2024
1 parent e09339f commit 975622d
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions app/SvgUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,12 +153,13 @@ def create_chromium_command(width, height, png_filepath, svg_filepath):
logging.error('CHROMIUM_EXECUTABLE_PATH is not set.')
return None

enable_hardware_acceleration = os.getenv('ENABLE_HARDWARE_ACCELERATION', 'false').lower() == 'true'

command = [
chromium_executable,
'--headless=old',
'--no-sandbox',
'--disable-gpu',
'--disable-software-rasterizer',
'--disable-dev-shm-usage',
'--default-background-color=00000000',
'--hide-scrollbars',
'--enable-features=ConversionMeasurement,AttributionReportingCrossAppWeb',
Expand All @@ -167,13 +168,6 @@ def create_chromium_command(width, height, png_filepath, svg_filepath):
svg_filepath,
]

if not enable_hardware_acceleration:
command.extend([
'--disable-gpu',
'--disable-software-rasterizer',
'--disable-dev-shm-usage',
])

return command


Expand Down

0 comments on commit 975622d

Please sign in to comment.