Commit 30fd4309 authored by 林生雨's avatar 林生雨

commit

parent ff2695bd
...@@ -5,7 +5,14 @@ ...@@ -5,7 +5,14 @@
<option name="TOOL_WINDOW_CONFIGURED_FILTER" value="Show only selected application" /> <option name="TOOL_WINDOW_CONFIGURED_FILTER" value="Show only selected application" />
</component> </component>
<component name="ChangeListManager"> <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$/.dart_tool/" />
<ignored path="$PROJECT_DIR$/.idea/" /> <ignored path="$PROJECT_DIR$/.idea/" />
<ignored path="$PROJECT_DIR$/.pub/" /> <ignored path="$PROJECT_DIR$/.pub/" />
...@@ -27,8 +34,8 @@ ...@@ -27,8 +34,8 @@
<file pinned="false" current-in-tab="false"> <file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/example/lib/AlbumModel/page/album/AlbumModel.dart"> <entry file="file://$PROJECT_DIR$/example/lib/AlbumModel/page/album/AlbumModel.dart">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="263"> <state relative-caret-position="169">
<caret line="101" column="16" selection-start-line="101" selection-start-column="16" selection-end-line="101" selection-end-column="16" /> <caret line="151" column="36" selection-start-line="151" selection-start-column="36" selection-end-line="151" selection-end-column="36" />
<folding> <folding>
<element signature="e#46#66#0" expanded="true" /> <element signature="e#46#66#0" expanded="true" />
</folding> </folding>
...@@ -37,10 +44,15 @@ ...@@ -37,10 +44,15 @@
</entry> </entry>
</file> </file>
<file pinned="false" current-in-tab="false"> <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"> <entry file="file://$PROJECT_DIR$/example/lib/AlbumModel/page/album/AlbumPage.dart">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="190"> <state relative-caret-position="871">
<caret line="15" column="2" selection-start-line="15" selection-start-column="2" selection-end-line="15" selection-end-column="2" /> <caret line="118" column="35" selection-start-line="118" selection-start-column="35" selection-end-line="118" selection-end-column="35" />
<folding> <folding>
<element signature="e#45#62#0" expanded="true" /> <element signature="e#45#62#0" expanded="true" />
</folding> </folding>
...@@ -48,10 +60,10 @@ ...@@ -48,10 +60,10 @@
</provider> </provider>
</entry> </entry>
</file> </file>
<file pinned="false" current-in-tab="true"> <file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/lib/ScanImagePlugn.dart"> <entry file="file://$PROJECT_DIR$/lib/ScanImagePlugn.dart">
<provider selected="true" editor-type-id="text-editor"> <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" /> <caret line="19" column="71" selection-start-line="19" selection-start-column="10" selection-end-line="19" selection-end-column="71" />
<folding> <folding>
<element signature="e#45#86#0" expanded="true" /> <element signature="e#45#86#0" expanded="true" />
...@@ -69,23 +81,11 @@ ...@@ -69,23 +81,11 @@
</provider> </provider>
</entry> </entry>
</file> </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"> <file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/example/lib/AlbumModel/repository/AlbumRepository.dart"> <entry file="file://$PROJECT_DIR$/example/lib/AlbumModel/repository/AlbumRepository.dart">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="207"> <state relative-caret-position="251">
<caret line="23" column="43" selection-start-line="23" selection-start-column="30" selection-end-line="23" selection-end-column="43" /> <caret line="26" column="25" selection-start-line="26" selection-start-column="25" selection-end-line="29" selection-end-column="9" />
<folding> <folding>
<element signature="e#46#106#0" expanded="true" /> <element signature="e#46#106#0" expanded="true" />
</folding> </folding>
...@@ -106,7 +106,7 @@ ...@@ -106,7 +106,7 @@
<entry file="file://$PROJECT_DIR$/ios/Classes/GengmeiFlutterPlugin.m"> <entry file="file://$PROJECT_DIR$/ios/Classes/GengmeiFlutterPlugin.m">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="11418"> <state relative-caret-position="11418">
<caret line="541" column="22" selection-start-line="541" selection-start-column="22" selection-end-line="541" selection-end-column="22" /> <caret line="540" column="22" selection-start-line="540" selection-start-column="22" selection-end-line="540" selection-end-column="22" />
</state> </state>
</provider> </provider>
</entry> </entry>
...@@ -154,6 +154,7 @@ ...@@ -154,6 +154,7 @@
<find>_dirList</find> <find>_dirList</find>
<find>_onEvent</find> <find>_onEvent</find>
<find>paseAlbum</find> <find>paseAlbum</find>
<find>print</find>
</findStrings> </findStrings>
</component> </component>
<component name="Git.Settings"> <component name="Git.Settings">
...@@ -177,11 +178,11 @@ ...@@ -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$/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$/lib/SharedPlugin.dart" />
<option value="$PROJECT_DIR$/example/lib/main.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$/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$/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> </list>
</option> </option>
</component> </component>
...@@ -241,6 +242,14 @@ ...@@ -241,6 +242,14 @@
<item name="page" type="462c0819:PsiDirectoryNode" /> <item name="page" type="462c0819:PsiDirectoryNode" />
<item name="album" type="462c0819:PsiDirectoryNode" /> <item name="album" type="462c0819:PsiDirectoryNode" />
</path> </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> <path>
<item name="gengmei_flutter_plugin" type="b2602c69:ProjectViewProjectNode" /> <item name="gengmei_flutter_plugin" type="b2602c69:ProjectViewProjectNode" />
<item name="gengmei_flutter_plugin" type="462c0819:PsiDirectoryNode" /> <item name="gengmei_flutter_plugin" type="462c0819:PsiDirectoryNode" />
...@@ -298,7 +307,7 @@ ...@@ -298,7 +307,7 @@
<frame x="9" y="23" width="1440" height="811" extended-state="6" /> <frame x="9" y="23" width="1440" height="811" extended-state="6" />
<editor active="true" /> <editor active="true" />
<layout> <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="Captures" order="1" side_tool="true" />
<window_info id="Structure" order="2" side_tool="true" /> <window_info id="Structure" order="2" side_tool="true" />
<window_info id="Image Layers" order="3" /> <window_info id="Image Layers" order="3" />
...@@ -313,7 +322,7 @@ ...@@ -313,7 +322,7 @@
<window_info anchor="bottom" id="Android Profiler" order="3" show_stripe_button="false" /> <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="Logcat" order="4" weight="0.4534075" />
<window_info anchor="bottom" id="Debug" order="5" /> <window_info anchor="bottom" id="Debug" order="5" />
<window_info active="true" anchor="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="Event Log" order="7" side_tool="true" />
<window_info anchor="bottom" id="Flutter Performance" order="8" side_tool="true" /> <window_info anchor="bottom" id="Flutter Performance" order="8" side_tool="true" />
<window_info anchor="bottom" id="Version Control" order="9" /> <window_info anchor="bottom" id="Version Control" order="9" />
...@@ -378,9 +387,6 @@ ...@@ -378,9 +387,6 @@
</state> </state>
</provider> </provider>
</entry> </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$/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$/lib/A.dart" />
<entry file="file://$PROJECT_DIR$/android/src/main/java/com/example/gengmei_flutter_plugin/a" /> <entry file="file://$PROJECT_DIR$/android/src/main/java/com/example/gengmei_flutter_plugin/a" />
...@@ -539,7 +545,7 @@ ...@@ -539,7 +545,7 @@
<entry file="file://$PROJECT_DIR$/ios/Classes/GengmeiFlutterPlugin.m"> <entry file="file://$PROJECT_DIR$/ios/Classes/GengmeiFlutterPlugin.m">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="11418"> <state relative-caret-position="11418">
<caret line="541" column="22" selection-start-line="541" selection-start-column="22" selection-end-line="541" selection-end-column="22" /> <caret line="540" column="22" selection-start-line="540" selection-start-column="22" selection-end-line="540" selection-end-column="22" />
</state> </state>
</provider> </provider>
</entry> </entry>
...@@ -549,49 +555,52 @@ ...@@ -549,49 +555,52 @@
<entry file="file://$PROJECT_DIR$/ios/Classes/Image/ResultManager.m"> <entry file="file://$PROJECT_DIR$/ios/Classes/Image/ResultManager.m">
<provider selected="true" editor-type-id="text-editor" /> <provider selected="true" editor-type-id="text-editor" />
</entry> </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"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="207"> <state relative-caret-position="121">
<caret line="23" column="43" selection-start-line="23" selection-start-column="30" selection-end-line="23" selection-end-column="43" /> <caret line="342" column="20" selection-start-line="342" selection-start-column="20" selection-end-line="342" selection-end-column="20" />
<folding>
<element signature="e#46#106#0" expanded="true" />
</folding>
</state> </state>
</provider> </provider>
</entry> </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"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="121"> <state relative-caret-position="352">
<caret line="342" column="20" selection-start-line="342" selection-start-column="20" selection-end-line="342" selection-end-column="20" /> <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> </state>
</provider> </provider>
</entry> </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"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="190"> <state relative-caret-position="251">
<caret line="15" column="2" selection-start-line="15" selection-start-column="2" selection-end-line="15" selection-end-column="2" /> <caret line="26" column="25" selection-start-line="26" selection-start-column="25" selection-end-line="29" selection-end-column="9" />
<folding> <folding>
<element signature="e#45#62#0" expanded="true" /> <element signature="e#46#106#0" expanded="true" />
</folding> </folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/example/lib/AlbumModel/page/album/AlbumModel.dart"> <entry file="file://$PROJECT_DIR$/example/lib/AlbumModel/page/album/AlbumModel.dart">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="263"> <state relative-caret-position="169">
<caret line="101" column="16" selection-start-line="101" selection-start-column="16" selection-end-line="101" selection-end-column="16" /> <caret line="151" column="36" selection-start-line="151" selection-start-column="36" selection-end-line="151" selection-end-column="36" />
<folding> <folding>
<element signature="e#46#66#0" expanded="true" /> <element signature="e#46#66#0" expanded="true" />
</folding> </folding>
</state> </state>
</provider> </provider>
</entry> </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"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="263"> <state relative-caret-position="871">
<caret line="19" column="71" selection-start-line="19" selection-start-column="10" selection-end-line="19" selection-end-column="71" /> <caret line="118" column="35" selection-start-line="118" selection-start-column="35" selection-end-line="118" selection-end-column="35" />
<folding> <folding>
<element signature="e#45#86#0" expanded="true" /> <element signature="e#45#62#0" expanded="true" />
</folding> </folding>
</state> </state>
</provider> </provider>
......
...@@ -148,7 +148,7 @@ class AlbumModel { ...@@ -148,7 +148,7 @@ class AlbumModel {
if (value != null) { if (value != null) {
_mainValue = value; _mainValue = value;
value.forEach((key, eachValue) { value.forEach((key, eachValue) {
print("VALUE!!! $key"); // print("VALUE!!! $key");
if (eachValue != null && !eachValue.isEmpty) { if (eachValue != null && !eachValue.isEmpty) {
if (key == MainDir) { if (key == MainDir) {
titleData.notifyView(MainDirExplain); titleData.notifyView(MainDirExplain);
......
...@@ -115,7 +115,7 @@ class AlbumState extends State<AlbumPage> { ...@@ -115,7 +115,7 @@ class AlbumState extends State<AlbumPage> {
initialData: _model.albumLive.data, initialData: _model.albumLive.data,
builder: builder:
(BuildContext context, AsyncSnapshot<List<ScanImageItem>> imgList) { (BuildContext context, AsyncSnapshot<List<ScanImageItem>> imgList) {
print("FINALL $imgList ${imgList.data}"); // print("FINALL $imgList ${imgList.data}");
if (imgList.data == null) { if (imgList.data == null) {
return Center(child: CircularProgressIndicator()); return Center(child: CircularProgressIndicator());
} }
......
...@@ -24,10 +24,10 @@ class AlbumRepository { ...@@ -24,10 +24,10 @@ class AlbumRepository {
Observable<Map<String, List<ScanImageItem>>> scanPhoneImg() { Observable<Map<String, List<ScanImageItem>>> scanPhoneImg() {
return Observable.fromFuture(GengmeiFlutterPlugin.phoneImages()) return Observable.fromFuture(GengmeiFlutterPlugin.phoneImages())
.map((value) { .map((value) {
if (value != null) { // if (value != null) {
_cacheList.clear(); // _cacheList.clear();
_cacheList.addAll(value); // _cacheList.addAll(value);
} // }
return value; return value;
}); });
} }
......
...@@ -45,7 +45,7 @@ NSString *cacheDirectory; ...@@ -45,7 +45,7 @@ NSString *cacheDirectory;
[registrar addMethodCallDelegate:instance channel:channel]; [registrar addMethodCallDelegate:instance channel:channel];
assetCollectionList = [NSMutableArray array]; assetCollectionList = [NSMutableArray array];
viewController =[UIApplication sharedApplication].delegate.window.rootViewController; 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); queue = dispatch_queue_create("com.gengmei_flutter_plugin", DISPATCH_QUEUE_SERIAL);
FlutterEventChannel* chargingChannel = [FlutterEventChannel FlutterEventChannel* chargingChannel = [FlutterEventChannel
eventChannelWithName:@"gengmei_flutter_plugin_event" eventChannelWithName:@"gengmei_flutter_plugin_event"
...@@ -298,7 +298,7 @@ NSString *cacheDirectory; ...@@ -298,7 +298,7 @@ NSString *cacheDirectory;
CGSize temp=CGSizeMake(picWidth*tempScareSize, picHeight*tempScareSize); 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] 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{ @autoreleasepool{
UIImage * res=[UIImage imageWithData:imageData]; UIImage * res=[UIImage imageWithData:imageData];
NSData *data = UIImageJPEGRepresentation(res, 0.8) ; NSData *data = UIImageJPEGRepresentation(res, 0.8) ;
...@@ -321,10 +321,10 @@ NSString *cacheDirectory; ...@@ -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]; NSMutableDictionary *dict=[[NSMutableDictionary alloc] init];
[dict setObject:path[i] forKey:@"path"]; [dict setObject:path[i] forKey:@"path"];
[dict setObject:self.takePhotoMap[path] forKey:@"realImagePath"]; [dict setObject:self.takePhotoMap[path[i]] forKey:@"realImagePath"];
@synchronized (self) { @synchronized (self) {
self.channelSize++; self.channelSize++;
[self.channelList addObject:dict]; [self.channelList addObject:dict];
...@@ -392,7 +392,7 @@ NSString *cacheDirectory; ...@@ -392,7 +392,7 @@ NSString *cacheDirectory;
[image drawInRect:CGRectMake(0,0,newSize.width,newSize.height)]; [image drawInRect:CGRectMake(0,0,newSize.width,newSize.height)];
UIImage* newImage = UIGraphicsGetImageFromCurrentImageContext(); UIImage* newImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext(); UIGraphicsEndImageContext();
NSData *data= UIImageJPEGRepresentation(newImage,0.8); NSData *data= UIImageJPEGRepresentation(newImage,0.6);
NSString *guid = [[NSProcessInfo processInfo] globallyUniqueString]; NSString *guid = [[NSProcessInfo processInfo] globallyUniqueString];
NSString *tmpFile = [NSString stringWithFormat:@"image_picker_%@", guid]; NSString *tmpFile = [NSString stringWithFormat:@"image_picker_%@", guid];
NSString* tmpPath= [cacheDirectory stringByAppendingPathComponent:tmpFile]; NSString* tmpPath= [cacheDirectory stringByAppendingPathComponent:tmpFile];
...@@ -485,7 +485,7 @@ NSString *cacheDirectory; ...@@ -485,7 +485,7 @@ NSString *cacheDirectory;
} }
-(void)scanPhoneImage{ -(void)scanPhoneImage{
// //
PHFetchResult<PHAssetCollection *> *favoritesCollection = [PHAssetCollection fetchAssetCollectionsWithType:PHAssetCollectionTypeSmartAlbum subtype:PHAssetCollectionSubtypeSmartAlbumFavorites options:nil]; PHFetchResult<PHAssetCollection *> *favoritesCollection = [PHAssetCollection fetchAssetCollectionsWithType:PHAssetCollectionTypeSmartAlbum subtype:PHAssetCollectionSubtypeSmartAlbumFavorites options:nil];
// 获得相机胶卷 // 获得相机胶卷
PHFetchResult<PHAssetCollection *> *assetCollections = [PHAssetCollection fetchAssetCollectionsWithType:PHAssetCollectionTypeAlbum subtype:PHAssetCollectionSubtypeSmartAlbumUserLibrary options:nil]; PHFetchResult<PHAssetCollection *> *assetCollections = [PHAssetCollection fetchAssetCollectionsWithType:PHAssetCollectionTypeAlbum subtype:PHAssetCollectionSubtypeSmartAlbumUserLibrary options:nil];
...@@ -554,7 +554,7 @@ NSString *cacheDirectory; ...@@ -554,7 +554,7 @@ NSString *cacheDirectory;
-(void) saveItemAndUpload:(NSMutableDictionary*)queryItemDict :(PHAsset*)assets :(NSString*)tmpPath :(NSString*)docName :(long)resultId{ -(void) saveItemAndUpload:(NSMutableDictionary*)queryItemDict :(PHAsset*)assets :(NSString*)tmpPath :(NSString*)docName :(long)resultId{
NSLog(@"RUNNING THREAD %@",[NSThread currentThread]); NSLog(@"RUNNING THREAD %@",[NSThread currentThread]);
// @synchronized (self) { @synchronized (self) {
self.nowSize++; self.nowSize++;
[self.scanMap setObject:assets forKey:tmpPath]; [self.scanMap setObject:assets forKey:tmpPath];
NSMutableArray * arr=self.finalMap[docName]; NSMutableArray * arr=self.finalMap[docName];
...@@ -590,7 +590,7 @@ NSString *cacheDirectory; ...@@ -590,7 +590,7 @@ NSString *cacheDirectory;
self.finalMap=[self.finalMapTemp mutableCopy]; self.finalMap=[self.finalMapTemp mutableCopy];
} }
} }
// } }
} }
-(void) copyImg:(long)resultId{ -(void) copyImg:(long)resultId{
...@@ -626,6 +626,7 @@ NSString *cacheDirectory; ...@@ -626,6 +626,7 @@ NSString *cacheDirectory;
if(assets.mediaType==PHAssetMediaTypeVideo){ if(assets.mediaType==PHAssetMediaTypeVideo){
if ([fileManager fileExistsAtPath:tmpPath]==YES){ if ([fileManager fileExistsAtPath:tmpPath]==YES){
[[PHImageManager defaultManager]requestAVAssetForVideo:assets options:options resultHandler:^(AVAsset * _Nullable asset, AVAudioMix * _Nullable audioMix, NSDictionary * _Nullable info) { [[PHImageManager defaultManager]requestAVAssetForVideo:assets options:options resultHandler:^(AVAsset * _Nullable asset, AVAudioMix * _Nullable audioMix, NSDictionary * _Nullable info) {
NSLog(@"VIDEO EXITTTT ");
dispatch_async(queue, ^{ dispatch_async(queue, ^{
AVURLAsset *urlAsset = (AVURLAsset *)asset; AVURLAsset *urlAsset = (AVURLAsset *)asset;
NSMutableDictionary* queryItemDict = [NSMutableDictionary dictionary]; NSMutableDictionary* queryItemDict = [NSMutableDictionary dictionary];
...@@ -658,6 +659,8 @@ NSString *cacheDirectory; ...@@ -658,6 +659,8 @@ NSString *cacheDirectory;
result=nil; result=nil;
} }
[[PHImageManager defaultManager]requestAVAssetForVideo:assets options:options resultHandler:^(AVAsset * _Nullable asset, AVAudioMix * _Nullable audioMix, NSDictionary * _Nullable info) { [[PHImageManager defaultManager]requestAVAssetForVideo:assets options:options resultHandler:^(AVAsset * _Nullable asset, AVAudioMix * _Nullable audioMix, NSDictionary * _Nullable info) {
//疑问 为什么不切换到对应的线程。。
// dispatch_async(queue, ^{
AVURLAsset *urlAsset = (AVURLAsset *)asset; AVURLAsset *urlAsset = (AVURLAsset *)asset;
NSMutableDictionary* queryItemDict = [NSMutableDictionary dictionary]; NSMutableDictionary* queryItemDict = [NSMutableDictionary dictionary];
[queryItemDict setObject:[self getVideoDuring:urlAsset.duration] forKey:@"during"]; [queryItemDict setObject:[self getVideoDuring:urlAsset.duration] forKey:@"during"];
...@@ -665,6 +668,7 @@ NSString *cacheDirectory; ...@@ -665,6 +668,7 @@ NSString *cacheDirectory;
[queryItemDict setObject:@"T" forKey:@"isVideo"]; [queryItemDict setObject:@"T" forKey:@"isVideo"];
[queryItemDict setObject:[NSString stringWithFormat:@"%ld", (long)[assets.creationDate timeIntervalSince1970]*1000] forKey:@"dataToken"]; [queryItemDict setObject:[NSString stringWithFormat:@"%ld", (long)[assets.creationDate timeIntervalSince1970]*1000] forKey:@"dataToken"];
[self saveItemAndUpload:queryItemDict :assets :tmpPath :docName :resultId]; [self saveItemAndUpload:queryItemDict :assets :tmpPath :docName :resultId];
// });
}]; }];
}]; }];
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment