Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
midjourney-proxy
Overview
Overview
Details
Activity
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
徐少华
midjourney-proxy
Commits
ea211445
Commit
ea211445
authored
Nov 15, 2018
by
田超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug for color
parent
cae5276b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
PictureUtil.java
...on/src/main/java/com/pcloud/common/utils/PictureUtil.java
+4
-2
temp.jpg
temp.jpg
+0
-0
No files found.
pcloud-common/src/main/java/com/pcloud/common/utils/PictureUtil.java
View file @
ea211445
...
@@ -38,7 +38,9 @@ public class PictureUtil {
...
@@ -38,7 +38,9 @@ public class PictureUtil {
public
static
Color
getImagePixel
(
BufferedImage
bi
)
{
public
static
Color
getImagePixel
(
BufferedImage
bi
)
{
if
(
bi
.
getWidth
()*
bi
.
getHeight
()>
10000
)
{
if
(
bi
.
getWidth
()*
bi
.
getHeight
()>
10000
)
{
BufferedImage
pic1
=
new
BufferedImage
(
60
,
60
,
BufferedImage
.
TYPE_3BYTE_BGR
);
BufferedImage
pic1
=
new
BufferedImage
(
350
,
350
,
BufferedImage
.
TYPE_3BYTE_BGR
);
Graphics
graphics
=
pic1
.
getGraphics
();
graphics
.
drawImage
(
bi
.
getScaledInstance
(
350
,
350
,
Image
.
SCALE_SMOOTH
),
0
,
0
,
null
);
bi
=
pic1
;
bi
=
pic1
;
}
}
int
width
=
bi
.
getWidth
();
int
width
=
bi
.
getWidth
();
...
@@ -161,7 +163,7 @@ public class PictureUtil {
...
@@ -161,7 +163,7 @@ public class PictureUtil {
}
}
imagePixel
=
getImagePixel
(
bi
);
imagePixel
=
getImagePixel
(
bi
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
imagePixel
=
Color
.
CYAN
;
imagePixel
=
Color
.
gray
;
LOGGER
.
warn
(
"生成图片失败,图片="
+
imgFile
+
","
+
e
.
getMessage
(),
e
);
LOGGER
.
warn
(
"生成图片失败,图片="
+
imgFile
+
","
+
e
.
getMessage
(),
e
);
}
}
return
imagePixel
;
return
imagePixel
;
...
...
temp.jpg
0 → 100644
View file @
ea211445
This diff is collapsed.
Click to expand it.
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