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
d502a751
Commit
d502a751
authored
Oct 31, 2019
by
林生雨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commit
parent
f5a11ea7
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
10 deletions
+14
-10
workspace.xml
.idea/workspace.xml
+2
-1
GengmeiFlutterPlugin.m
ios/Classes/GengmeiFlutterPlugin.m
+12
-9
No files found.
.idea/workspace.xml
View file @
d502a751
...
...
@@ -8,6 +8,7 @@
<list
default=
"true"
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/"
/>
...
...
@@ -315,7 +316,7 @@
<window_info
anchor=
"bottom"
id=
"Android Profiler"
order=
"3"
show_stripe_button=
"false"
/>
<window_info
anchor=
"bottom"
id=
"Logcat"
order=
"4"
weight=
"0.4534075"
/>
<window_info
anchor=
"bottom"
id=
"Debug"
order=
"5"
/>
<window_info
active=
"true"
anchor=
"bottom"
id=
"Terminal"
order=
"6"
visible=
"true"
weight=
"0.
6175243
"
/>
<window_info
active=
"true"
anchor=
"bottom"
id=
"Terminal"
order=
"6"
visible=
"true"
weight=
"0.
29346314
"
/>
<window_info
anchor=
"bottom"
id=
"Event Log"
order=
"7"
side_tool=
"true"
/>
<window_info
anchor=
"bottom"
id=
"Flutter Performance"
order=
"8"
side_tool=
"true"
/>
<window_info
anchor=
"bottom"
id=
"Version Control"
order=
"9"
/>
...
...
ios/Classes/GengmeiFlutterPlugin.m
View file @
d502a751
...
...
@@ -16,8 +16,6 @@
@property
(
strong
,
atomic
)
NSMutableDictionary
<
NSString
*
,
NSMutableArray
<
NSMutableDictionary
<
NSString
*
,
NSObject
*>*>*>*
finalMapTemp
;
@property
(
nonatomic
,
strong
)
UIImagePickerController
*
imagePicker
;
@property
(
nonatomic
)
Boolean
quitPage
;
@property
(
atomic
)
Boolean
execdTask
;
@property
(
atomic
)
Boolean
copyScareImgOk
;
@property
(
atomic
)
Boolean
finishScanImg
;
@property
(
atomic
,
strong
)
NSMutableDictionary
<
NSString
*
,
PHAsset
*>*
scanMap
;
@property
(
atomic
,
strong
)
NSMutableDictionary
<
NSString
*
,
NSString
*>*
takePhotoMap
;
...
...
@@ -428,12 +426,14 @@ NSString *cacheDirectory;
[[
ResultManager
sharedSingleton
]
resultSuccess
:[
NSNumber
numberWithLong
:
self
.
nativeCameraKey
]
:
nil
];
}
CFAbsoluteTime
startTime
;
-
(
void
)
scanPhone
:(
long
)
resultId
{
self
.
quitPage
=
false
;
if
(
self
.
finishScanImg
)
{
[[
ResultManager
sharedSingleton
]
resultSuccess
:[
NSNumber
numberWithLong
:
resultId
]
:
self
.
finalMap
];
return
;
}
startTime
=
CFAbsoluteTimeGetCurrent
();
if
(
self
.
finalMap
==
nil
)
{
self
.
finalMap
=
[
NSMutableDictionary
dictionary
];
}
...
...
@@ -557,7 +557,6 @@ NSString *cacheDirectory;
self
.
nowSize
++
;
[
self
.
scanMap
setObject
:
assets
forKey
:
tmpPath
];
NSMutableArray
*
arr
=
self
.
finalMap
[
docName
];
@synchronized
(
self
)
{
if
(
arr
==
nil
)
{
self
.
finalMap
[
docName
]
=
[
NSMutableArray
array
];
[
self
.
finalMap
[
docName
]
addObject
:
queryItemDict
];
...
...
@@ -565,7 +564,6 @@ NSString *cacheDirectory;
[
self
.
finalMap
[
docName
]
addObject
:
queryItemDict
];
}
[
self
.
finalMap
[
@"IsGengmeiAlbumAllImages"
]
addObject
:
queryItemDict
];
}
NSLog
(
@"SCARE SIZEEE %d %d "
,
self
.
nowSize
,
self
.
needSize
);
if
(
self
.
needSize
>
200
){
if
(
self
.
nowSize
<=
201
){
...
...
@@ -582,11 +580,15 @@ NSString *cacheDirectory;
[
self
reslutImg
:
resultId
];
}
else
if
(
self
.
nowSize
==
self
.
needSize
){
self
.
finishScanImg
=
true
;
CFAbsoluteTime
linkTime
=
(
CFAbsoluteTimeGetCurrent
()
-
startTime
);
NSLog
(
@"IOS COPY IMAGE 时间:%f ms"
,
linkTime
*
1000
.
0
);
[
self
upImgs
];
}
}
else
{
if
(
self
.
nowSize
==
self
.
needSize
)
{
self
.
finishScanImg
=
true
;
CFAbsoluteTime
linkTime
=
(
CFAbsoluteTimeGetCurrent
()
-
startTime
);
NSLog
(
@"IOS COPY IMAGE 时间:%f ms"
,
linkTime
*
1000
.
0
);
[
self
reslutImg
:
resultId
];
self
.
finalMap
=
[
self
.
finalMapTemp
mutableCopy
];
}
...
...
@@ -639,6 +641,8 @@ NSString *cacheDirectory;
});
}];
}
else
{
[[
PHImageManager
defaultManager
]
requestAVAssetForVideo
:
assets
options
:
options
resultHandler
:^
(
AVAsset
*
_Nullable
asset
,
AVAudioMix
*
_Nullable
audioMix
,
NSDictionary
*
_Nullable
info
)
{
//疑问 为什么不切换到对应的线程。。
int
picWidth
=
[
assets
pixelWidth
];
int
picHeight
=
[
assets
pixelHeight
];
float
tempScareSize
=
1
;
...
...
@@ -656,12 +660,10 @@ NSString *cacheDirectory;
@autoreleasepool
{
NSData
*
data
=
UIImageJPEGRepresentation
(
result
,
0
.
8
)
;
[
data
writeToFile
:
tmpPath
atomically
:
YES
];
data
=
nil
;
result
=
nil
;
//
data=nil;
//
result=nil;
}
[[
PHImageManager
defaultManager
]
requestAVAssetForVideo
:
assets
options
:
options
resultHandler
:^
(
AVAsset
*
_Nullable
asset
,
AVAudioMix
*
_Nullable
audioMix
,
NSDictionary
*
_Nullable
info
)
{
//疑问 为什么不切换到对应的线程。。
dispatch_async
(
queue
,
^
{
dispatch_sync
(
queue
,
^
{
AVURLAsset
*
urlAsset
=
(
AVURLAsset
*
)
asset
;
NSMutableDictionary
*
queryItemDict
=
[
NSMutableDictionary
dictionary
];
[
queryItemDict
setObject
:[
self
getVideoDuring
:
urlAsset
.
duration
]
forKey
:
@"during"
];
...
...
@@ -672,6 +674,7 @@ NSString *cacheDirectory;
});
}];
}];
}
}
else
{
if
([
fileManager
fileExistsAtPath
:
tmpPath
]
==
YES
){
...
...
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