Skip to content

Commit

Permalink
2.5
Browse files Browse the repository at this point in the history
fix many bug
  • Loading branch information
riceshowerX committed Jul 30, 2024
1 parent e4c0155 commit ef9f52b
Show file tree
Hide file tree
Showing 11 changed files with 62 additions and 25 deletions.
1 change: 1 addition & 0 deletions .idea/.name

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/SnapForge.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 23 additions & 14 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified core/__pycache__/config.cpython-312.pyc
Binary file not shown.
Binary file modified core/__pycache__/error_handler.cpython-312.pyc
Binary file not shown.
Binary file modified core/__pycache__/image_processor.cpython-312.pyc
Binary file not shown.
20 changes: 10 additions & 10 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ def on_directory_selected(self, data):
self.root.ids.target_button.text = '已选择: {}'.format(self.target_directory)

def rename_files(self, instance):
if not self.source_directory or not self.target_directory:
self.show_error_message("请先选择原始和保存图片文件夹!")
if not self.source_file or not self.target_directory:
self.show_error_message("请先选择原始图片文件和保存图片文件夹!")
return

prefix = self.root.ids.prefix_input.text
Expand All @@ -90,7 +90,7 @@ def rename_files(self, instance):

self.progress_value = 0
renamed_count = self.image_processor.batch_rename_files(
self.source_directory,
self.source_file,
self.target_directory,
prefix,
start_number,
Expand All @@ -99,8 +99,8 @@ def rename_files(self, instance):
self.show_info_message(f"重命名完成!共重命名了 {renamed_count} 个文件。")

def convert_files(self, instance):
if not self.source_directory or not self.target_directory:
self.show_error_message("请先选择原始和保存图片文件夹!")
if not self.source_file or not self.target_directory:
self.show_error_message("请先选择原始图片文件和保存图片文件夹!")
return

target_format = self.root.ids.format_input.text
Expand All @@ -110,16 +110,16 @@ def convert_files(self, instance):

self.progress_value = 0
converted_count = self.image_processor.batch_convert_images(
self.source_directory,
self.source_file,
self.target_directory,
target_format,
self.update_progress
)
self.show_info_message(f"转换完成!共转换了 {converted_count} 个文件。")

def compress_files(self, instance):
if not self.source_directory or not self.target_directory:
self.show_error_message("请先选择原始和保存图片文件夹!")
if not self.source_file or not self.target_directory:
self.show_error_message("请先选择原始图片文件和保存图片文件夹!")
return

try:
Expand All @@ -130,7 +130,7 @@ def compress_files(self, instance):

self.progress_value = 0
compressed_count = self.image_processor.batch_compress_images(
self.source_directory,
self.source_file,
self.target_directory,
quality,
self.update_progress
Expand All @@ -149,4 +149,4 @@ def show_error_message(self, message):


if __name__ == "__main__":
SnapForgeApp().run()
SnapForgeApp().run()
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
kivy
pillow
jnius
jnius
cython

0 comments on commit ef9f52b

Please sign in to comment.