diff --git a/.idea/.name b/.idea/.name
new file mode 100644
index 0000000..11a5d8e
--- /dev/null
+++ b/.idea/.name
@@ -0,0 +1 @@
+main.py
\ No newline at end of file
diff --git a/.idea/SnapForge.iml b/.idea/SnapForge.iml
new file mode 100644
index 0000000..0070e87
--- /dev/null
+++ b/.idea/SnapForge.iml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml
new file mode 100644
index 0000000..105ce2d
--- /dev/null
+++ b/.idea/inspectionProfiles/profiles_settings.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..a2bf591
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 0000000..35eb1dd
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index b6bf813..9be04c8 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -4,12 +4,19 @@
-
+
+
+
+
+
+
+
+
{
"associatedIndex": 4
}
@@ -18,20 +25,21 @@
- {
- "keyToString": {
- "Python.main.executor": "Run",
- "Python.main_window.executor": "Run",
- "RunOnceActivity.ShowReadmeOnStart": "true",
- "last_opened_file_path": "F:/HuaweiMoveData/Users/Administrator/Documents/GitHub/新建文件夹",
- "node.js.detected.package.eslint": "true",
- "node.js.detected.package.tslint": "true",
- "node.js.selected.package.eslint": "(autodetect)",
- "node.js.selected.package.tslint": "(autodetect)",
- "nodejs_package_manager_path": "npm",
- "vue.rearranger.settings.migration": "true"
+
+}]]>
@@ -49,6 +57,7 @@
1722322014301
+
diff --git a/core/__pycache__/config.cpython-312.pyc b/core/__pycache__/config.cpython-312.pyc
index e895e7b..df42115 100644
Binary files a/core/__pycache__/config.cpython-312.pyc and b/core/__pycache__/config.cpython-312.pyc differ
diff --git a/core/__pycache__/error_handler.cpython-312.pyc b/core/__pycache__/error_handler.cpython-312.pyc
index 6a808dc..fc04e90 100644
Binary files a/core/__pycache__/error_handler.cpython-312.pyc and b/core/__pycache__/error_handler.cpython-312.pyc differ
diff --git a/core/__pycache__/image_processor.cpython-312.pyc b/core/__pycache__/image_processor.cpython-312.pyc
index 1c5cd5f..bb63c3b 100644
Binary files a/core/__pycache__/image_processor.cpython-312.pyc and b/core/__pycache__/image_processor.cpython-312.pyc differ
diff --git a/main.py b/main.py
index 8e5190f..127f8b8 100644
--- a/main.py
+++ b/main.py
@@ -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
@@ -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,
@@ -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
@@ -110,7 +110,7 @@ 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
@@ -118,8 +118,8 @@ def convert_files(self, instance):
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:
@@ -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
@@ -149,4 +149,4 @@ def show_error_message(self, message):
if __name__ == "__main__":
- SnapForgeApp().run()
+ SnapForgeApp().run()
\ No newline at end of file
diff --git a/requirements.txt b/requirements.txt
index 0901995..17c8bd8 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,3 +1,4 @@
kivy
pillow
-jnius
\ No newline at end of file
+jnius
+cython
\ No newline at end of file