Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
柴进
/
GoogleNanoBananaApp
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
e6410bd2
authored
2026-03-02 10:45:08 +0800
by
柴进
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
清理无用代码
1 parent
8b46fb30
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
image_generator.py
image_generator.py
View file @
e6410bd
...
...
@@ -1133,7 +1133,7 @@ class DragDropScrollArea(QScrollArea):
if
mime_data
.
hasImage
():
image
=
mime_data
.
imageData
()
if
isinstance
(
image
,
QImage
)
and
not
image
.
isNull
():
self
.
parent_window
.
add_clipboard_image
(
image
)
self
.
parent_window
.
add_clipboard_image
(
image
.
copy
()
)
event
.
acceptProposedAction
()
return
except
Exception
:
...
...
@@ -1934,13 +1934,13 @@ class ImageGeneratorWindow(QMainWindow):
if
raw_data
and
len
(
raw_data
)
>
0
:
image
=
QImage
()
if
image
.
loadFromData
(
raw_data
):
return
image
return
image
.
copy
()
# 尝试 hasImage + imageData
if
mime_data
.
hasImage
():
image_data
=
mime_data
.
imageData
()
if
isinstance
(
image_data
,
QImage
)
and
not
image_data
.
isNull
():
return
image_data
return
image_data
.
copy
()
except
Exception
as
e
:
self
.
logger
.
warning
(
f
"MIME data 方式获取剪贴板图像失败: {e}"
)
...
...
@@ -1971,7 +1971,7 @@ class ImageGeneratorWindow(QMainWindow):
if
result
.
returncode
==
0
and
temp_path
.
exists
()
and
temp_path
.
stat
()
.
st_size
>
0
:
image
=
QImage
(
str
(
temp_path
))
if
not
image
.
isNull
():
return
image
return
image
.
copy
()
except
Exception
as
e
:
self
.
logger
.
warning
(
f
"osascript 方式获取剪贴板图像失败: {e}"
)
...
...
@@ -1979,7 +1979,7 @@ class ImageGeneratorWindow(QMainWindow):
try
:
image
=
clipboard
.
image
()
if
image
and
not
image
.
isNull
():
return
image
return
image
.
copy
()
except
Exception
as
e
:
self
.
logger
.
warning
(
f
"clipboard.image() 失败: {e}"
)
...
...
Please
register
or
sign in
to post a comment