Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Q
qk_backend
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
quanku
qk_backend
Commits
df54b458
Commit
df54b458
authored
Aug 22, 2024
by
shiyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
无旋转的商品不处理
parent
aa6599c6
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
14 deletions
+6
-14
ch-admin-api/src/main/java/com/wwdz/ch/admin/controller/AdminStorageController.java
.../com/wwdz/ch/admin/controller/AdminStorageController.java
+2
-1
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/ItemServiceImpl.java
...pi/src/main/java/com/wwdz/ch/wx/impl/ItemServiceImpl.java
+2
-11
ch-wx-api/src/main/java/com/wwdz/ch/wx/web/WxStorageController.java
...src/main/java/com/wwdz/ch/wx/web/WxStorageController.java
+2
-2
No files found.
ch-admin-api/src/main/java/com/wwdz/ch/admin/controller/AdminStorageController.java
View file @
df54b458
...
@@ -87,7 +87,8 @@ public class AdminStorageController {
...
@@ -87,7 +87,8 @@ public class AdminStorageController {
if
(
orientationResult
.
getNeedRepaint
())
{
if
(
orientationResult
.
getNeedRepaint
())
{
logger
.
info
(
"当前图片需要进行重绘,旋转角度:【{}】"
,
orientationResult
.
getAngel
());
logger
.
info
(
"当前图片需要进行重绘,旋转角度:【{}】"
,
orientationResult
.
getAngel
());
targetInput
=
ImgUtil
.
repaintImage2InputStream
(
image
,
orientationResult
.
getAngel
(),
orientationResult
.
getType
());
targetInput
=
ImgUtil
.
repaintImage2InputStream
(
image
,
orientationResult
.
getAngel
(),
orientationResult
.
getType
());
}
else
{
targetInput
=
file
.
getInputStream
();
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
"get image size failed : "
,
e
);
logger
.
error
(
"get image size failed : "
,
e
);
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/ItemServiceImpl.java
View file @
df54b458
...
@@ -1107,16 +1107,6 @@ public class ItemServiceImpl implements ItemService {
...
@@ -1107,16 +1107,6 @@ public class ItemServiceImpl implements ItemService {
@Override
@Override
public
Result
uploadImage
(
MultipartFile
file
)
{
public
Result
uploadImage
(
MultipartFile
file
)
{
try
{
try
{
/* InputStream inputStream = file.getInputStream();
BufferedImage bufferedImage = ImageIO.read(inputStream);*/
/* String lastKey = ".jpg";
if (StringUtils.isNotBlank(file.getOriginalFilename())) {
lastKey = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf("."));
}
String keyName = CommConsts.UPLOAD_PRE_DIRECTORY + CommonUtils.getUUID() + "_" + bufferedImage.getWidth() + "x" + bufferedImage.getHeight() + lastKey;
InputStream imageStream = bufferedImageToInputStream(bufferedImage, lastKey.substring(1));
qiniuStorage.store(imageStream, file.getSize(), file.getContentType(), keyName);*/
InputStream
targetInput
=
null
;
InputStream
targetInput
=
null
;
try
(
InputStream
inputStream
=
file
.
getInputStream
())
{
try
(
InputStream
inputStream
=
file
.
getInputStream
())
{
BufferedImage
image
=
ImageIO
.
read
(
inputStream
);
BufferedImage
image
=
ImageIO
.
read
(
inputStream
);
...
@@ -1124,7 +1114,8 @@ public class ItemServiceImpl implements ItemService {
...
@@ -1124,7 +1114,8 @@ public class ItemServiceImpl implements ItemService {
if
(
orientationResult
.
getNeedRepaint
())
{
if
(
orientationResult
.
getNeedRepaint
())
{
logger
.
info
(
"当前图片需要进行重绘,旋转角度:【{}】"
,
orientationResult
.
getAngel
());
logger
.
info
(
"当前图片需要进行重绘,旋转角度:【{}】"
,
orientationResult
.
getAngel
());
targetInput
=
ImgUtil
.
repaintImage2InputStream
(
image
,
orientationResult
.
getAngel
(),
orientationResult
.
getType
());
targetInput
=
ImgUtil
.
repaintImage2InputStream
(
image
,
orientationResult
.
getAngel
(),
orientationResult
.
getType
());
}
else
{
targetInput
=
file
.
getInputStream
();
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
"get image size failed : "
,
e
);
logger
.
error
(
"get image size failed : "
,
e
);
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/web/WxStorageController.java
View file @
df54b458
...
@@ -89,12 +89,12 @@ public class WxStorageController {
...
@@ -89,12 +89,12 @@ public class WxStorageController {
if
(
orientationResult
.
getNeedRepaint
())
{
if
(
orientationResult
.
getNeedRepaint
())
{
logger
.
info
(
"当前图片需要进行重绘,旋转角度:【{}】"
,
orientationResult
.
getAngel
());
logger
.
info
(
"当前图片需要进行重绘,旋转角度:【{}】"
,
orientationResult
.
getAngel
());
targetInput
=
ImgUtil
.
repaintImage2InputStream
(
image
,
orientationResult
.
getAngel
(),
orientationResult
.
getType
());
targetInput
=
ImgUtil
.
repaintImage2InputStream
(
image
,
orientationResult
.
getAngel
(),
orientationResult
.
getType
());
}
else
{
targetInput
=
file
.
getInputStream
();
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
"get image size failed : "
,
e
);
logger
.
error
(
"get image size failed : "
,
e
);
}
}
String
url
=
storageService
.
store
(
targetInput
,
file
.
getSize
(),
file
.
getContentType
(),
originalFilename
);
String
url
=
storageService
.
store
(
targetInput
,
file
.
getSize
(),
file
.
getContentType
(),
originalFilename
);
Map
<
String
,
Object
>
data
=
new
HashMap
<>();
Map
<
String
,
Object
>
data
=
new
HashMap
<>();
data
.
put
(
"url"
,
url
);
data
.
put
(
"url"
,
url
);
...
...
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