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
30fd4309
Commit
30fd4309
authored
Oct 31, 2019
by
林生雨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commit
parent
ff2695bd
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
78 additions
and
65 deletions
+78
-65
workspace.xml
.idea/workspace.xml
+59
-50
AlbumModel.dart
example/lib/AlbumModel/page/album/AlbumModel.dart
+1
-1
AlbumPage.dart
example/lib/AlbumModel/page/album/AlbumPage.dart
+1
-1
AlbumRepository.dart
example/lib/AlbumModel/repository/AlbumRepository.dart
+4
-4
GengmeiFlutterPlugin.m
ios/Classes/GengmeiFlutterPlugin.m
+13
-9
No files found.
.idea/workspace.xml
View file @
30fd4309
...
...
@@ -5,7 +5,14 @@
<option
name=
"TOOL_WINDOW_CONFIGURED_FILTER"
value=
"Show only selected application"
/>
</component>
<component
name=
"ChangeListManager"
>
<list
default=
"true"
id=
"5be6bbb5-7d6e-4540-a24f-d2b3bf78b3ba"
name=
"Default Changelist"
comment=
""
/>
<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$/example/lib/AlbumModel/page/album/AlbumModel.dart"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/example/lib/AlbumModel/page/album/AlbumModel.dart"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/example/lib/AlbumModel/page/album/AlbumPage.dart"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/example/lib/AlbumModel/page/album/AlbumPage.dart"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/example/lib/AlbumModel/repository/AlbumRepository.dart"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/example/lib/AlbumModel/repository/AlbumRepository.dart"
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/"
/>
...
...
@@ -27,8 +34,8 @@
<file
pinned=
"false"
current-in-tab=
"false"
>
<entry
file=
"file://$PROJECT_DIR$/example/lib/AlbumModel/page/album/AlbumModel.dart"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
263
"
>
<caret
line=
"1
01"
column=
"16"
selection-start-line=
"101"
selection-start-column=
"16"
selection-end-line=
"101"
selection-end-column=
"1
6"
/>
<state
relative-caret-position=
"
169
"
>
<caret
line=
"1
51"
column=
"36"
selection-start-line=
"151"
selection-start-column=
"36"
selection-end-line=
"151"
selection-end-column=
"3
6"
/>
<folding>
<element
signature=
"e#46#66#0"
expanded=
"true"
/>
</folding>
...
...
@@ -37,10 +44,15 @@
</entry>
</file>
<file
pinned=
"false"
current-in-tab=
"false"
>
<entry
file=
"file://$PROJECT_DIR$/example/lib/AlbumModel/LiveData.dart"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
/>
</entry>
</file>
<file
pinned=
"false"
current-in-tab=
"true"
>
<entry
file=
"file://$PROJECT_DIR$/example/lib/AlbumModel/page/album/AlbumPage.dart"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
190
"
>
<caret
line=
"1
5"
column=
"2"
selection-start-line=
"15"
selection-start-column=
"2"
selection-end-line=
"15"
selection-end-column=
"2
"
/>
<state
relative-caret-position=
"
871
"
>
<caret
line=
"1
18"
column=
"35"
selection-start-line=
"118"
selection-start-column=
"35"
selection-end-line=
"118"
selection-end-column=
"35
"
/>
<folding>
<element
signature=
"e#45#62#0"
expanded=
"true"
/>
</folding>
...
...
@@ -48,10 +60,10 @@
</provider>
</entry>
</file>
<file
pinned=
"false"
current-in-tab=
"
tru
e"
>
<file
pinned=
"false"
current-in-tab=
"
fals
e"
>
<entry
file=
"file://$PROJECT_DIR$/lib/ScanImagePlugn.dart"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
263
"
>
<state
relative-caret-position=
"
352
"
>
<caret
line=
"19"
column=
"71"
selection-start-line=
"19"
selection-start-column=
"10"
selection-end-line=
"19"
selection-end-column=
"71"
/>
<folding>
<element
signature=
"e#45#86#0"
expanded=
"true"
/>
...
...
@@ -69,23 +81,11 @@
</provider>
</entry>
</file>
<file
pinned=
"false"
current-in-tab=
"false"
>
<entry
file=
"file://$PROJECT_DIR$/lib/gengmei_flutter_plugin.dart"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"440"
>
<caret
line=
"26"
column=
"41"
selection-start-line=
"26"
selection-start-column=
"41"
selection-end-line=
"26"
selection-end-column=
"41"
/>
<folding>
<element
signature=
"e#0#20#0"
expanded=
"true"
/>
</folding>
</state>
</provider>
</entry>
</file>
<file
pinned=
"false"
current-in-tab=
"false"
>
<entry
file=
"file://$PROJECT_DIR$/example/lib/AlbumModel/repository/AlbumRepository.dart"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"2
07
"
>
<caret
line=
"2
3"
column=
"43"
selection-start-line=
"23"
selection-start-column=
"30"
selection-end-line=
"23"
selection-end-column=
"43
"
/>
<state
relative-caret-position=
"2
51
"
>
<caret
line=
"2
6"
column=
"25"
selection-start-line=
"26"
selection-start-column=
"25"
selection-end-line=
"29"
selection-end-column=
"9
"
/>
<folding>
<element
signature=
"e#46#106#0"
expanded=
"true"
/>
</folding>
...
...
@@ -106,7 +106,7 @@
<entry
file=
"file://$PROJECT_DIR$/ios/Classes/GengmeiFlutterPlugin.m"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"11418"
>
<caret
line=
"54
1"
column=
"22"
selection-start-line=
"541"
selection-start-column=
"22"
selection-end-line=
"541
"
selection-end-column=
"22"
/>
<caret
line=
"54
0"
column=
"22"
selection-start-line=
"540"
selection-start-column=
"22"
selection-end-line=
"540
"
selection-end-column=
"22"
/>
</state>
</provider>
</entry>
...
...
@@ -154,6 +154,7 @@
<find>
_dirList
</find>
<find>
_onEvent
</find>
<find>
paseAlbum
</find>
<find>
print
</find>
</findStrings>
</component>
<component
name=
"Git.Settings"
>
...
...
@@ -177,11 +178,11 @@
<option
value=
"$PROJECT_DIR$/android/src/main/java/com/example/gengmei_flutter_plugin/ImagePlugin/repository/luban/Engine.kt"
/>
<option
value=
"$PROJECT_DIR$/lib/SharedPlugin.dart"
/>
<option
value=
"$PROJECT_DIR$/example/lib/main.dart"
/>
<option
value=
"$PROJECT_DIR$/example/lib/AlbumModel/repository/AlbumRepository.dart"
/>
<option
value=
"$PROJECT_DIR$/example/lib/AlbumModel/page/album/AlbumPage.dart"
/>
<option
value=
"$PROJECT_DIR$/lib/gengmei_flutter_plugin.dart"
/>
<option
value=
"$PROJECT_DIR$/example/lib/AlbumModel/page/album/AlbumModel.dart"
/>
<option
value=
"$PROJECT_DIR$/lib/ScanImagePlugn.dart"
/>
<option
value=
"$PROJECT_DIR$/example/lib/AlbumModel/repository/AlbumRepository.dart"
/>
<option
value=
"$PROJECT_DIR$/example/lib/AlbumModel/page/album/AlbumModel.dart"
/>
<option
value=
"$PROJECT_DIR$/example/lib/AlbumModel/page/album/AlbumPage.dart"
/>
</list>
</option>
</component>
...
...
@@ -241,6 +242,14 @@
<item
name=
"page"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"album"
type=
"462c0819:PsiDirectoryNode"
/>
</path>
<path>
<item
name=
"gengmei_flutter_plugin"
type=
"b2602c69:ProjectViewProjectNode"
/>
<item
name=
"gengmei_flutter_plugin"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"example"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"lib"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"AlbumModel"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"repository"
type=
"462c0819:PsiDirectoryNode"
/>
</path>
<path>
<item
name=
"gengmei_flutter_plugin"
type=
"b2602c69:ProjectViewProjectNode"
/>
<item
name=
"gengmei_flutter_plugin"
type=
"462c0819:PsiDirectoryNode"
/>
...
...
@@ -298,7 +307,7 @@
<frame
x=
"9"
y=
"23"
width=
"1440"
height=
"811"
extended-state=
"6"
/>
<editor
active=
"true"
/>
<layout>
<window_info
content_ui=
"combo"
id=
"Project"
order=
"0"
visible=
"true"
weight=
"0.19742489"
/>
<window_info
active=
"true"
content_ui=
"combo"
id=
"Project"
order=
"0"
visible=
"true"
weight=
"0.19742489"
/>
<window_info
id=
"Captures"
order=
"1"
side_tool=
"true"
/>
<window_info
id=
"Structure"
order=
"2"
side_tool=
"true"
/>
<window_info
id=
"Image Layers"
order=
"3"
/>
...
...
@@ -313,7 +322,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
a
ctive=
"true"
a
nchor=
"bottom"
id=
"Terminal"
order=
"6"
visible=
"true"
weight=
"0.30458972"
/>
<window_info
anchor=
"bottom"
id=
"Terminal"
order=
"6"
visible=
"true"
weight=
"0.30458972"
/>
<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"
/>
...
...
@@ -378,9 +387,6 @@
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/example/lib/AlbumModel/LiveData.dart"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
/>
</entry>
<entry
file=
"file://$PROJECT_DIR$/android/src/main/kotlin/com/example/gengmei_flutter_plugin/sharedPrefernces/SharedManager.kt"
/>
<entry
file=
"file://$PROJECT_DIR$/lib/A.dart"
/>
<entry
file=
"file://$PROJECT_DIR$/android/src/main/java/com/example/gengmei_flutter_plugin/a"
/>
...
...
@@ -539,7 +545,7 @@
<entry
file=
"file://$PROJECT_DIR$/ios/Classes/GengmeiFlutterPlugin.m"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"11418"
>
<caret
line=
"54
1"
column=
"22"
selection-start-line=
"541"
selection-start-column=
"22"
selection-end-line=
"541
"
selection-end-column=
"22"
/>
<caret
line=
"54
0"
column=
"22"
selection-start-line=
"540"
selection-start-column=
"22"
selection-end-line=
"540
"
selection-end-column=
"22"
/>
</state>
</provider>
</entry>
...
...
@@ -549,49 +555,52 @@
<entry
file=
"file://$PROJECT_DIR$/ios/Classes/Image/ResultManager.m"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
/>
</entry>
<entry
file=
"file://$
PROJECT_DIR$/example/lib/AlbumModel/repository/AlbumRepository
.dart"
>
<entry
file=
"file://$
USER_HOME$/Downloads/flutter/packages/flutter/lib/src/services/platform_channel
.dart"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"207"
>
<caret
line=
"23"
column=
"43"
selection-start-line=
"23"
selection-start-column=
"30"
selection-end-line=
"23"
selection-end-column=
"43"
/>
<folding>
<element
signature=
"e#46#106#0"
expanded=
"true"
/>
</folding>
<state
relative-caret-position=
"121"
>
<caret
line=
"342"
column=
"20"
selection-start-line=
"342"
selection-start-column=
"20"
selection-end-line=
"342"
selection-end-column=
"20"
/>
</state>
</provider>
</entry>
<entry
file=
"file://$
USER_HOME$/Downloads/flutter/packages/flutter/lib/src/services/platform_channel
.dart"
>
<entry
file=
"file://$
PROJECT_DIR$/lib/ScanImagePlugn
.dart"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"121"
>
<caret
line=
"342"
column=
"20"
selection-start-line=
"342"
selection-start-column=
"20"
selection-end-line=
"342"
selection-end-column=
"20"
/>
<state
relative-caret-position=
"352"
>
<caret
line=
"19"
column=
"71"
selection-start-line=
"19"
selection-start-column=
"10"
selection-end-line=
"19"
selection-end-column=
"71"
/>
<folding>
<element
signature=
"e#45#86#0"
expanded=
"true"
/>
</folding>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/example/lib/AlbumModel/page/album/AlbumPage.dart"
>
<entry
file=
"file://$PROJECT_DIR$/example/lib/AlbumModel/LiveData.dart"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
/>
</entry>
<entry
file=
"file://$PROJECT_DIR$/example/lib/AlbumModel/repository/AlbumRepository.dart"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
190
"
>
<caret
line=
"
15"
column=
"2"
selection-start-line=
"15"
selection-start-column=
"2"
selection-end-line=
"15"
selection-end-column=
"2
"
/>
<state
relative-caret-position=
"
251
"
>
<caret
line=
"
26"
column=
"25"
selection-start-line=
"26"
selection-start-column=
"25"
selection-end-line=
"29"
selection-end-column=
"9
"
/>
<folding>
<element
signature=
"e#4
5#62
#0"
expanded=
"true"
/>
<element
signature=
"e#4
6#106
#0"
expanded=
"true"
/>
</folding>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/example/lib/AlbumModel/page/album/AlbumModel.dart"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
263
"
>
<caret
line=
"1
01"
column=
"16"
selection-start-line=
"101"
selection-start-column=
"16"
selection-end-line=
"101"
selection-end-column=
"1
6"
/>
<state
relative-caret-position=
"
169
"
>
<caret
line=
"1
51"
column=
"36"
selection-start-line=
"151"
selection-start-column=
"36"
selection-end-line=
"151"
selection-end-column=
"3
6"
/>
<folding>
<element
signature=
"e#46#66#0"
expanded=
"true"
/>
</folding>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/
lib/ScanImagePlugn
.dart"
>
<entry
file=
"file://$PROJECT_DIR$/
example/lib/AlbumModel/page/album/AlbumPage
.dart"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
263
"
>
<caret
line=
"1
9"
column=
"71"
selection-start-line=
"19"
selection-start-column=
"10"
selection-end-line=
"19"
selection-end-column=
"71
"
/>
<state
relative-caret-position=
"
871
"
>
<caret
line=
"1
18"
column=
"35"
selection-start-line=
"118"
selection-start-column=
"35"
selection-end-line=
"118"
selection-end-column=
"35
"
/>
<folding>
<element
signature=
"e#45#
86
#0"
expanded=
"true"
/>
<element
signature=
"e#45#
62
#0"
expanded=
"true"
/>
</folding>
</state>
</provider>
...
...
example/lib/AlbumModel/page/album/AlbumModel.dart
View file @
30fd4309
...
...
@@ -148,7 +148,7 @@ class AlbumModel {
if
(
value
!=
null
)
{
_mainValue
=
value
;
value
.
forEach
((
key
,
eachValue
)
{
print
(
"VALUE!!!
$key
"
);
//
print("VALUE!!! $key");
if
(
eachValue
!=
null
&&
!
eachValue
.
isEmpty
)
{
if
(
key
==
MainDir
)
{
titleData
.
notifyView
(
MainDirExplain
);
...
...
example/lib/AlbumModel/page/album/AlbumPage.dart
View file @
30fd4309
...
...
@@ -115,7 +115,7 @@ class AlbumState extends State<AlbumPage> {
initialData:
_model
.
albumLive
.
data
,
builder:
(
BuildContext
context
,
AsyncSnapshot
<
List
<
ScanImageItem
>>
imgList
)
{
print
(
"FINALL
$imgList
${imgList.data}
"
);
//
print("FINALL $imgList ${imgList.data}");
if
(
imgList
.
data
==
null
)
{
return
Center
(
child:
CircularProgressIndicator
());
}
...
...
example/lib/AlbumModel/repository/AlbumRepository.dart
View file @
30fd4309
...
...
@@ -24,10 +24,10 @@ class AlbumRepository {
Observable
<
Map
<
String
,
List
<
ScanImageItem
>>>
scanPhoneImg
()
{
return
Observable
.
fromFuture
(
GengmeiFlutterPlugin
.
phoneImages
())
.
map
((
value
)
{
if
(
value
!=
null
)
{
_cacheList
.
clear
();
_cacheList
.
addAll
(
value
);
}
//
if (value != null) {
//
_cacheList.clear();
//
_cacheList.addAll(value);
//
}
return
value
;
});
}
...
...
ios/Classes/GengmeiFlutterPlugin.m
View file @
30fd4309
...
...
@@ -45,7 +45,7 @@ NSString *cacheDirectory;
[
registrar
addMethodCallDelegate
:
instance
channel
:
channel
];
assetCollectionList
=
[
NSMutableArray
array
];
viewController
=
[
UIApplication
sharedApplication
].
delegate
.
window
.
rootViewController
;
// queue = dispatch_queue_create("com.gengmei_flutter_plugin", DISPATCH_QUEUE_CONCURRENT);
// queue = dispatch_queue_create("com.gengmei_flutter_plugin", DISPATCH_QUEUE_CONCURRENT);
queue
=
dispatch_queue_create
(
"com.gengmei_flutter_plugin"
,
DISPATCH_QUEUE_SERIAL
);
FlutterEventChannel
*
chargingChannel
=
[
FlutterEventChannel
eventChannelWithName
:
@"gengmei_flutter_plugin_event"
...
...
@@ -298,7 +298,7 @@ NSString *cacheDirectory;
CGSize
temp
=
CGSizeMake
(
picWidth
*
tempScareSize
,
picHeight
*
tempScareSize
);
[[
PHImageManager
defaultManager
]
requestImageDataForAsset
:
assets
options
:
imageRequestOption
resultHandler
:^
(
NSData
*
_Nullable
imageData
,
NSString
*
_Nullable
dataUTI
,
UIImageOrientation
orientation
,
NSDictionary
*
_Nullable
info
)
{
// [[PHImageManager defaultManager] requestImageForAsset:assets targetSize:temp contentMode:PHImageContentModeDefault options:imageRequestOption resultHandler:^(UIImage * _Nullable res, NSDictionary * _Nullable info) {
// [[PHImageManager defaultManager] requestImageForAsset:assets targetSize:temp contentMode:PHImageContentModeDefault options:imageRequestOption resultHandler:^(UIImage * _Nullable res, NSDictionary * _Nullable info) {
@autoreleasepool
{
UIImage
*
res
=
[
UIImage
imageWithData
:
imageData
];
NSData
*
data
=
UIImageJPEGRepresentation
(
res
,
0
.
8
)
;
...
...
@@ -321,10 +321,10 @@ NSString *cacheDirectory;
}];
}
}
}
else
if
([[
self
.
takePhotoMap
allKeys
]
containsObject
:
path
]){
}
else
if
([[
self
.
takePhotoMap
allKeys
]
containsObject
:
path
[
i
]
]){
NSMutableDictionary
*
dict
=
[[
NSMutableDictionary
alloc
]
init
];
[
dict
setObject
:
path
[
i
]
forKey
:
@"path"
];
[
dict
setObject
:
self
.
takePhotoMap
[
path
]
forKey
:
@"realImagePath"
];
[
dict
setObject
:
self
.
takePhotoMap
[
path
[
i
]
]
forKey
:
@"realImagePath"
];
@synchronized
(
self
)
{
self
.
channelSize
++
;
[
self
.
channelList
addObject
:
dict
];
...
...
@@ -392,7 +392,7 @@ NSString *cacheDirectory;
[
image
drawInRect
:
CGRectMake
(
0
,
0
,
newSize
.
width
,
newSize
.
height
)];
UIImage
*
newImage
=
UIGraphicsGetImageFromCurrentImageContext
();
UIGraphicsEndImageContext
();
NSData
*
data
=
UIImageJPEGRepresentation
(
newImage
,
0
.
8
);
NSData
*
data
=
UIImageJPEGRepresentation
(
newImage
,
0
.
6
);
NSString
*
guid
=
[[
NSProcessInfo
processInfo
]
globallyUniqueString
];
NSString
*
tmpFile
=
[
NSString
stringWithFormat
:
@"image_picker_%@"
,
guid
];
NSString
*
tmpPath
=
[
cacheDirectory
stringByAppendingPathComponent
:
tmpFile
];
...
...
@@ -485,7 +485,7 @@ NSString *cacheDirectory;
}
-
(
void
)
scanPhoneImage
{
//
//
PHFetchResult
<
PHAssetCollection
*>
*
favoritesCollection
=
[
PHAssetCollection
fetchAssetCollectionsWithType
:
PHAssetCollectionTypeSmartAlbum
subtype
:
PHAssetCollectionSubtypeSmartAlbumFavorites
options
:
nil
];
// 获得相机胶卷
PHFetchResult
<
PHAssetCollection
*>
*
assetCollections
=
[
PHAssetCollection
fetchAssetCollectionsWithType
:
PHAssetCollectionTypeAlbum
subtype
:
PHAssetCollectionSubtypeSmartAlbumUserLibrary
options
:
nil
];
...
...
@@ -554,7 +554,7 @@ NSString *cacheDirectory;
-
(
void
)
saveItemAndUpload
:
(
NSMutableDictionary
*
)
queryItemDict
:
(
PHAsset
*
)
assets
:
(
NSString
*
)
tmpPath
:
(
NSString
*
)
docName
:
(
long
)
resultId
{
NSLog
(
@"RUNNING THREAD %@"
,[
NSThread
currentThread
]);
//
@synchronized (self) {
@synchronized
(
self
)
{
self
.
nowSize
++
;
[
self
.
scanMap
setObject
:
assets
forKey
:
tmpPath
];
NSMutableArray
*
arr
=
self
.
finalMap
[
docName
];
...
...
@@ -580,7 +580,7 @@ NSString *cacheDirectory;
if
(
self
.
nowSize
==
201
){
[
self
reslutImg
:
resultId
];
}
else
if
(
self
.
nowSize
==
self
.
needSize
){
self
.
finishScanImg
=
true
;
self
.
finishScanImg
=
true
;
[
self
upImgs
];
}
}
else
{
...
...
@@ -590,7 +590,7 @@ NSString *cacheDirectory;
self
.
finalMap
=
[
self
.
finalMapTemp
mutableCopy
];
}
}
//
}
}
}
-
(
void
)
copyImg
:
(
long
)
resultId
{
...
...
@@ -626,6 +626,7 @@ NSString *cacheDirectory;
if
(
assets
.
mediaType
==
PHAssetMediaTypeVideo
){
if
([
fileManager
fileExistsAtPath
:
tmpPath
]
==
YES
){
[[
PHImageManager
defaultManager
]
requestAVAssetForVideo
:
assets
options
:
options
resultHandler
:^
(
AVAsset
*
_Nullable
asset
,
AVAudioMix
*
_Nullable
audioMix
,
NSDictionary
*
_Nullable
info
)
{
NSLog
(
@"VIDEO EXITTTT "
);
dispatch_async
(
queue
,
^
{
AVURLAsset
*
urlAsset
=
(
AVURLAsset
*
)
asset
;
NSMutableDictionary
*
queryItemDict
=
[
NSMutableDictionary
dictionary
];
...
...
@@ -658,6 +659,8 @@ NSString *cacheDirectory;
result
=
nil
;
}
[[
PHImageManager
defaultManager
]
requestAVAssetForVideo
:
assets
options
:
options
resultHandler
:^
(
AVAsset
*
_Nullable
asset
,
AVAudioMix
*
_Nullable
audioMix
,
NSDictionary
*
_Nullable
info
)
{
//疑问 为什么不切换到对应的线程。。
// dispatch_async(queue, ^{
AVURLAsset
*
urlAsset
=
(
AVURLAsset
*
)
asset
;
NSMutableDictionary
*
queryItemDict
=
[
NSMutableDictionary
dictionary
];
[
queryItemDict
setObject
:[
self
getVideoDuring
:
urlAsset
.
duration
]
forKey
:
@"during"
];
...
...
@@ -665,6 +668,7 @@ NSString *cacheDirectory;
[
queryItemDict
setObject
:
@"T"
forKey
:
@"isVideo"
];
[
queryItemDict
setObject
:[
NSString
stringWithFormat
:
@"%ld"
,
(
long
)[
assets
.
creationDate
timeIntervalSince1970
]
*
1000
]
forKey
:
@"dataToken"
];
[
self
saveItemAndUpload
:
queryItemDict
:
assets
:
tmpPath
:
docName
:
resultId
];
// });
}];
}];
}
...
...
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