Skip to content

Commit

Permalink
Update main.py
Browse files Browse the repository at this point in the history
  • Loading branch information
TransparentLC committed May 21, 2024
1 parent b389353 commit 5f8708d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import os
import re
import sys
import tempfile

if sys.platform != 'darwin':
import notifypy
Expand Down Expand Up @@ -470,11 +471,11 @@ def buttonProcess_click(self):
if os.path.splitext(f)[1].lower() == '.gif':
queue.append(task.SplitGIFTask(self.writeToOutput, self.progressValue, f, g, initialConfigParams, queue, self.varboolOptimizeGIF.get()))
elif self.varstrCustomCommand.get().strip():
t = task.buildTempPath('.png')
t = tempfile.mktemp('.png')
queue.append(task.RESpawnTask(self.writeToOutput, self.progressValue, f, t, initialConfigParams))
queue.append(task.CustomCompressTask(self.writeToOutput, t, g, self.varstrCustomCommand.get().strip(), True))
elif self.varboolLossyMode.get() and os.path.splitext(g)[1].lower() in {'.jpg', '.jpeg', '.webp'}:
t = task.buildTempPath('.webp')
t = tempfile.mktemp('.webp')
queue.append(task.RESpawnTask(self.writeToOutput, self.progressValue, f, t, initialConfigParams))
queue.append(task.LossyCompressTask(self.writeToOutput, t, g, self.varintLossyQuality.get(), True))
else:
Expand All @@ -491,11 +492,11 @@ def buttonProcess_click(self):
if os.path.splitext(inputPath)[1].lower() == '.gif':
queue.append(task.SplitGIFTask(self.writeToOutput, self.progressValue, inputPath, outputPath, initialConfigParams, queue, self.varboolOptimizeGIF.get()))
elif self.varstrCustomCommand.get().strip():
t = task.buildTempPath('.png')
t = tempfile.mktemp('.png')
queue.append(task.RESpawnTask(self.writeToOutput, self.progressValue, inputPath, t, initialConfigParams))
queue.append(task.CustomCompressTask(self.writeToOutput, t, outputPath, self.varstrCustomCommand.get().strip(), True))
elif self.varboolLossyMode.get() and os.path.splitext(outputPath)[1].lower() in {'.jpg', '.jpeg', '.webp'}:
t = task.buildTempPath('.webp')
t = tempfile.mktemp('.webp')
queue.append(task.RESpawnTask(self.writeToOutput, self.progressValue, inputPath, t, initialConfigParams))
queue.append(task.LossyCompressTask(self.writeToOutput, t, outputPath, self.varintLossyQuality.get(), True))
else:
Expand Down

0 comments on commit 5f8708d

Please sign in to comment.