Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cut_pic
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dovahkiin
cut_pic
Commits
eaff4fcb
Commit
eaff4fcb
authored
Aug 23, 2023
by
dovahkiin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改程序保存文件时路径错误以及*号不能作为保存文件的名字的问题。
parent
8d26d7e9
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
16 deletions
+20
-16
cut_pic.py
cut_pic.py
+18
-14
to_exe.py
to_exe.py
+1
-1
ui_main.py
ui_main.py
+1
-1
No files found.
cut_pic.py
View file @
eaff4fcb
...
...
@@ -220,13 +220,14 @@ def extractLayerImge(lay_info:lay_item, psd_name:str):
layer_name
=
layer_name
.
replace
(
'|'
,
"&"
)
pos_type
=
check_path
(
psd_name
)
if
pos_type
==
2
:
layer_name
=
".
\\
"
+
psd_name
[:
-
4
]
+
'
\\
'
+
layer_name
+
'.png'
if
pos_type
==
1
:
layer_name
=
psd_name
[:
-
4
]
+
'
\\
'
+
layer_name
+
'.png'
# 空格替换为下划线
layer_name
=
layer_name
.
replace
(
' '
,
'_'
)
layer_name
=
layer_name
.
replace
(
'*'
,
'x'
)
if
pos_type
==
2
:
layer_name
=
".
\\
"
+
psd_name
[:
-
4
]
+
'/'
+
layer_name
+
'.png'
if
pos_type
==
1
:
layer_name
=
psd_name
[:
-
4
]
+
'/'
+
layer_name
+
'.png'
x1
=
lay_info
.
x
y1
=
lay_info
.
y
...
...
@@ -235,7 +236,10 @@ def extractLayerImge(lay_info:lay_item, psd_name:str):
pos
=
(
x1
,
y1
,
x2
,
y2
)
xywh
=
(
lay_info
.
x
,
lay_info
.
y
,
lay_info
.
w
,
lay_info
.
h
)
if
lay_info
.
x
!=
0
or
lay_info
.
y
!=
0
:
layer_image
=
psd
.
composite
(
viewport
=
pos
,
force
=
True
)
# layer_image.show(layer_name)
print
(
"[# layer_image #]:"
,
layer_image
,
"xywh:"
,
xywh
)
# temp_psd_show = psd.compose(True)
...
...
to_exe.py
View file @
eaff4fcb
...
...
@@ -5,7 +5,7 @@ import time
def
to_exe
():
# 改这两个
# 主要的py,py入口
main_py
=
"
agasdfa
.py"
main_py
=
"
ui_main
.py"
# 其他导入的py文件
# secondary = [
# "comm_class.py",
...
...
ui_main.py
View file @
eaff4fcb
...
...
@@ -76,7 +76,7 @@ class Pyqt5_Cut_psd(QtWidgets.QMainWindow, Ui_Form):
# 读取文件地址
def
__read_file_path
(
self
):
file_path
=
QFileDialog
.
getOpenFileName
(
self
,
"选择PSD文件"
,
os
.
getcwd
(),
'
表格
文件(*.psd)'
)
file_path
=
QFileDialog
.
getOpenFileName
(
self
,
"选择PSD文件"
,
os
.
getcwd
(),
'
PSD
文件(*.psd)'
)
if
(
file_path
!=
''
):
self
.
let_psd_name
.
setText
(
file_path
[
0
])
print
(
file_path
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment