Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
flutter_plugin
Project
Project
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
林生雨
flutter_plugin
Commits
7185c022
Commit
7185c022
authored
Jan 10, 2020
by
林生雨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commit
parent
f663c2bf
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
32 deletions
+18
-32
workspace.xml
.idea/workspace.xml
+7
-4
GengmeiFlutterPlugin.m
ios/Classes/GengmeiFlutterPlugin.m
+11
-28
No files found.
.idea/workspace.xml
View file @
7185c022
...
...
@@ -6,7 +6,11 @@
<option
name=
"TOOL_WINDOW_CONFIGURED_FILTER"
value=
"Show only selected application"
/>
</component>
<component
name=
"ChangeListManager"
>
<list
default=
"$ENABLE_FLUTTER_DESKTOP$"
id=
"5be6bbb5-7d6e-4540-a24f-d2b3bf78b3ba"
name=
"Default Changelist"
comment=
""
/>
<list
default=
"$ENABLE_FLUTTER_DESKTOP$"
id=
"5be6bbb5-7d6e-4540-a24f-d2b3bf78b3ba"
name=
"Default Changelist"
comment=
""
>
<change
beforePath=
"$PROJECT_DIR$/.idea/workspace.xml"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/.idea/workspace.xml"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/example/ios/.symlinks/plugins/gengmei_flutter_plugin/.idea/workspace.xml"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/example/ios/.symlinks/plugins/gengmei_flutter_plugin/.idea/workspace.xml"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/ios/Classes/GengmeiFlutterPlugin.m"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/ios/Classes/GengmeiFlutterPlugin.m"
afterDir=
"false"
/>
</list>
<ignored
path=
"$PROJECT_DIR$/.dart_tool/"
/>
<ignored
path=
"$PROJECT_DIR$/.idea/"
/>
<ignored
path=
"$PROJECT_DIR$/.pub/"
/>
...
...
@@ -51,7 +55,7 @@
<entry
file=
"file://$PROJECT_DIR$/ios/Classes/GengmeiFlutterPlugin.m"
>
<provider
selected=
"$ENABLE_FLUTTER_DESKTOP$"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"150"
>
<caret
line=
"251"
column=
"22"
lean-forward=
"$ENABLE_FLUTTER_DESKTOP$"
selection-start-line=
"251"
selection-start-column=
"22"
selection-end-line=
"251"
selection-end-column=
"22"
/>
<caret
line=
"251"
column=
"22"
selection-start-line=
"251"
selection-start-column=
"22"
selection-end-line=
"251"
selection-end-column=
"22"
/>
</state>
</provider>
</entry>
...
...
@@ -280,7 +284,6 @@
</component>
<component
name=
"ToolWindowManager"
>
<frame
x=
"-7"
y=
"30"
width=
"1440"
height=
"825"
extended-state=
"6"
/>
<editor
active=
"$ENABLE_FLUTTER_DESKTOP$"
/>
<layout>
<window_info
content_ui=
"combo"
id=
"Project"
order=
"0"
visible=
"$ENABLE_FLUTTER_DESKTOP$"
weight=
"0.19742489"
/>
<window_info
id=
"Captures"
order=
"1"
side_tool=
"$ENABLE_FLUTTER_DESKTOP$"
/>
...
...
@@ -623,7 +626,7 @@
<entry
file=
"file://$PROJECT_DIR$/ios/Classes/GengmeiFlutterPlugin.m"
>
<provider
selected=
"$ENABLE_FLUTTER_DESKTOP$"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"150"
>
<caret
line=
"251"
column=
"22"
lean-forward=
"$ENABLE_FLUTTER_DESKTOP$"
selection-start-line=
"251"
selection-start-column=
"22"
selection-end-line=
"251"
selection-end-column=
"22"
/>
<caret
line=
"251"
column=
"22"
selection-start-line=
"251"
selection-start-column=
"22"
selection-end-line=
"251"
selection-end-column=
"22"
/>
</state>
</provider>
</entry>
...
...
ios/Classes/GengmeiFlutterPlugin.m
View file @
7185c022
...
...
@@ -54,8 +54,8 @@ PHImageRequestOptions *baseImageRequestOption;
baseImageRequestOption
=
[[
PHImageRequestOptions
alloc
]
init
];
baseImageRequestOption
.
synchronous
=
NO
;
baseImageRequestOption
.
networkAccessAllowed
=
YES
;
baseImageRequestOption
.
deliveryMode
=
PHImageRequestOptionsDeliveryModeHighQualityFormat
;
//
baseImageRequestOption.deliveryMode=PHImageRequestOptionsDeliveryModeFastFormat;
//
baseImageRequestOption.deliveryMode=PHImageRequestOptionsDeliveryModeHighQualityFormat;
baseImageRequestOption
.
deliveryMode
=
PHImageRequestOptionsDeliveryModeFastFormat
;
baseImageRequestOption
.
resizeMode
=
PHImageRequestOptionsResizeModeFast
;
baseImageRequestOption
.
version
=
PHImageRequestOptionsVersionUnadjusted
;
...
...
@@ -525,38 +525,21 @@ PHImageRequestOptions *baseImageRequestOption;
if
([[
self
.
scanMap
allKeys
]
containsObject
:
path
]){
PHAsset
*
assets
=
self
.
scanMap
[
path
];
@autoreleasepool
{
CFAbsoluteTime
startTime
=
CFAbsoluteTimeGetCurrent
();
int
picWidth
=
[
assets
pixelWidth
];
int
picHeight
=
[
assets
pixelHeight
];
float
tempScareSize
=
1
;
int
max
=
MAX
(
picWidth
,
picHeight
);
if
(
max
>
1080
){
tempScareSize
=
1080
/
max
;
}
CGSize
temp
=
CGSizeMake
(
picWidth
*
tempScareSize
,
picHeight
*
tempScareSize
);
[[
PHImageManager
defaultManager
]
requestImageForAsset
:
assets
targetSize
:
temp
contentMode
:
PHImageContentModeDefault
options
:
baseImageRequestOption
resultHandler
:^
(
UIImage
*
_Nullable
result
,
NSDictionary
*
_Nullable
info
)
{
[[
PHImageManager
defaultManager
]
requestImageDataForAsset
:
assets
options
:
baseImageRequestOption
resultHandler
:^
(
NSData
*
_Nullable
imageData
,
NSString
*
_Nullable
dataUTI
,
UIImageOrientation
orientation
,
NSDictionary
*
_Nullable
info
)
{
CFAbsoluteTime
linkTime
=
(
CFAbsoluteTimeGetCurrent
()
-
startTime
);
NSLog
(
@"requestImageDataForAsset Time %f ms"
,
linkTime
*
1000
.
0
);
[[
ResultManager
sharedSingleton
]
resultSuccess
:[
NSNumber
numberWithLong
:
resultTemp
]
:
[
FlutterStandardTypedData
typedDataWithBytes
:
UIImageJPEGRepresentation
(
result
,
1
.
0
)]];
}];
// [[PHImageManager defaultManager] requestImageDataForAsset:assets options:baseImageRequestOption resultHandler:^(NSData * _Nullable imageData, NSString * _Nullable dataUTI, UIImageOrientation orientation, NSDictionary * _Nullable info) {
// CFAbsoluteTime linkTime = (CFAbsoluteTimeGetCurrent() - startTime);
// NSLog(@"requestImageDataForAsset Time %f ms", linkTime *1000.0);
// NSData *imageDataW = nil;
// if ([dataUTI isEqualToString:@"public.heif"] || [dataUTI isEqualToString:@"public.heic"]) {
NSData
*
imageDataW
=
nil
;
if
([
dataUTI
isEqualToString
:
@"public.heif"
]
||
[
dataUTI
isEqualToString
:
@"public.heic"
])
{
// CIImage *ciImage = [CIImage imageWithData:imageData];
// CIContext *context = [CIContext context];
// NSData *jpgData = [context JPEGRepresentationOfImage:ciImage colorSpace:ciImage.colorSpace options:@{}];
// imageDataW = jpgData;
// } else {
// imageDataW = imageData;
// }
//// if ([imageDataW length] / (1024 * 1024) > 3.0) {
//// imageDataW = [[UIImage imageWithData: imageDataW] c]; //图片大于3M压缩操作,可不调用此方法
//// }
// //
// [[ResultManager sharedSingleton] resultSuccess:[NSNumber numberWithLong:resultTemp] :[FlutterStandardTypedData typedDataWithBytes:imageDataW]];
// }];
imageDataW
=
UIImageJPEGRepresentation
([
UIImage
imageWithData
:
imageData
],
1
.
0
);
}
else
{
imageDataW
=
imageData
;
}
[[
ResultManager
sharedSingleton
]
resultSuccess
:[
NSNumber
numberWithLong
:
resultTemp
]
:
[
FlutterStandardTypedData
typedDataWithBytes
:
imageDataW
]];
}];
}
}
else
if
([[
self
.
takePhotoMap
allKeys
]
containsObject
:
path
]){
@autoreleasepool
{
...
...
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