Commit 8d135558 authored by 林生雨's avatar 林生雨

commit

parent 0c3dbbff
...@@ -5,7 +5,12 @@ ...@@ -5,7 +5,12 @@
<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$/ios/Classes/GengmeiFlutterPlugin.m" beforeDir="false" afterPath="$PROJECT_DIR$/ios/Classes/GengmeiFlutterPlugin.m" afterDir="false" />
<change beforePath="$PROJECT_DIR$/lib/ScanImagePlugn.dart" beforeDir="false" afterPath="$PROJECT_DIR$/lib/ScanImagePlugn.dart" 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/" />
...@@ -51,8 +56,8 @@ ...@@ -51,8 +56,8 @@
<file pinned="false" current-in-tab="true"> <file pinned="false" current-in-tab="true">
<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="217"> <state relative-caret-position="285">
<caret line="29" selection-start-line="29" selection-end-line="29" /> <caret line="19" column="21" selection-start-line="19" selection-start-column="13" selection-end-line="19" selection-end-column="21" />
<folding> <folding>
<element signature="e#45#86#0" expanded="true" /> <element signature="e#45#86#0" expanded="true" />
</folding> </folding>
...@@ -105,8 +110,8 @@ ...@@ -105,8 +110,8 @@
<file pinned="false" current-in-tab="false"> <file pinned="false" current-in-tab="false">
<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="11572"> <state relative-caret-position="11418">
<caret line="548" column="22" selection-start-line="548" selection-start-column="22" selection-end-line="548" selection-end-column="22" /> <caret line="541" column="22" selection-start-line="541" selection-start-column="22" selection-end-line="541" selection-end-column="22" />
</state> </state>
</provider> </provider>
</entry> </entry>
...@@ -296,7 +301,6 @@ ...@@ -296,7 +301,6 @@
</component> </component>
<component name="ToolWindowManager"> <component name="ToolWindowManager">
<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" />
<layout> <layout>
<window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.19742489" /> <window_info 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" />
...@@ -313,7 +317,7 @@ ...@@ -313,7 +317,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.44506258" /> <window_info active="true" 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" />
...@@ -538,8 +542,8 @@ ...@@ -538,8 +542,8 @@
</entry> </entry>
<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="11572"> <state relative-caret-position="11418">
<caret line="548" column="22" selection-start-line="548" selection-start-column="22" selection-end-line="548" selection-end-column="22" /> <caret line="541" column="22" selection-start-line="541" selection-start-column="22" selection-end-line="541" selection-end-column="22" />
</state> </state>
</provider> </provider>
</entry> </entry>
...@@ -588,8 +592,8 @@ ...@@ -588,8 +592,8 @@
</entry> </entry>
<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="217"> <state relative-caret-position="285">
<caret line="29" selection-start-line="29" selection-end-line="29" /> <caret line="19" column="21" selection-start-line="19" selection-start-column="13" selection-end-line="19" selection-end-column="21" />
<folding> <folding>
<element signature="e#45#86#0" expanded="true" /> <element signature="e#45#86#0" expanded="true" />
</folding> </folding>
......
...@@ -463,20 +463,6 @@ NSString *cacheDirectory; ...@@ -463,20 +463,6 @@ NSString *cacheDirectory;
}); });
} }
- (void)getThumbnailImages
{
// 获得所有的自定义相簿
PHFetchResult<PHAssetCollection *> *assetCollections = [PHAssetCollection fetchAssetCollectionsWithType:PHAssetCollectionTypeAlbum subtype:PHAssetCollectionSubtypeAlbumRegular options:nil];
// 遍历所有的自定义相簿
for (PHAssetCollection *assetCollection in assetCollections) {
[self enumerateAssetsInAssetCollection:assetCollection original:NO];
}
// 获得相机胶卷
PHAssetCollection *cameraRoll = [PHAssetCollection fetchAssetCollectionsWithType:PHAssetCollectionTypeSmartAlbum subtype:PHAssetCollectionSubtypeSmartAlbumUserLibrary options:nil].lastObject;
[self enumerateAssetsInAssetCollection:cameraRoll original:NO];
}
- (void)enumerateAssetsInAssetCollection:(PHAssetCollection *)assetCollection original:(BOOL)original - (void)enumerateAssetsInAssetCollection:(PHAssetCollection *)assetCollection original:(BOOL)original
{ {
NSLog(@"相簿名:%@", assetCollection.localizedTitle); NSLog(@"相簿名:%@", assetCollection.localizedTitle);
...@@ -499,9 +485,12 @@ NSString *cacheDirectory; ...@@ -499,9 +485,12 @@ NSString *cacheDirectory;
} }
-(void)scanPhoneImage{ -(void)scanPhoneImage{
PHFetchResult<PHAssetCollection *> *favoritesCollection = [PHAssetCollection fetchAssetCollectionsWithType:PHAssetCollectionTypeSmartAlbum subtype:PHAssetCollectionSubtypeSmartAlbumFavorites options:NO]; PHFetchOptions *fetchOptions = [[PHFetchOptions alloc]init];
// NSSortDescriptor *sort = [NSSortDescriptor sortDescriptorWithKey:@"creationDate" ascending:NO];
// fetchOptions.sortDescriptors = @[sort];
PHFetchResult<PHAssetCollection *> *favoritesCollection = [PHAssetCollection fetchAssetCollectionsWithType:PHAssetCollectionTypeSmartAlbum subtype:PHAssetCollectionSubtypeSmartAlbumFavorites options:fetchOptions];
// 获得相机胶卷 // 获得相机胶卷
PHFetchResult<PHAssetCollection *> *assetCollections = [PHAssetCollection fetchAssetCollectionsWithType:PHAssetCollectionTypeAlbum subtype:PHAssetCollectionSubtypeSmartAlbumUserLibrary options:NO]; PHFetchResult<PHAssetCollection *> *assetCollections = [PHAssetCollection fetchAssetCollectionsWithType:PHAssetCollectionTypeAlbum subtype:PHAssetCollectionSubtypeSmartAlbumUserLibrary options:fetchOptions];
// 获得全部相片 // 获得全部相片
PHFetchResult<PHAssetCollection *> *cameraRolls = [PHAssetCollection fetchAssetCollectionsWithType:PHAssetCollectionTypeSmartAlbum subtype:PHAssetCollectionSubtypeSmartAlbumUserLibrary options:NO]; PHFetchResult<PHAssetCollection *> *cameraRolls = [PHAssetCollection fetchAssetCollectionsWithType:PHAssetCollectionTypeSmartAlbum subtype:PHAssetCollectionSubtypeSmartAlbumUserLibrary options:NO];
...@@ -644,6 +633,7 @@ NSString *cacheDirectory; ...@@ -644,6 +633,7 @@ NSString *cacheDirectory;
[queryItemDict setObject:[self getVideoDuring:urlAsset.duration] forKey:@"during"]; [queryItemDict setObject:[self getVideoDuring:urlAsset.duration] forKey:@"during"];
[queryItemDict setObject:tmpPath forKey:@"path"]; [queryItemDict setObject:tmpPath forKey:@"path"];
[queryItemDict setObject:@"T" forKey:@"isVideo"]; [queryItemDict setObject:@"T" forKey:@"isVideo"];
[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];
}); });
}]; }];
...@@ -674,16 +664,17 @@ NSString *cacheDirectory; ...@@ -674,16 +664,17 @@ NSString *cacheDirectory;
[queryItemDict setObject:[self getVideoDuring:urlAsset.duration] forKey:@"during"]; [queryItemDict setObject:[self getVideoDuring:urlAsset.duration] forKey:@"during"];
[queryItemDict setObject:tmpPath forKey:@"path"]; [queryItemDict setObject:tmpPath forKey:@"path"];
[queryItemDict setObject:@"T" forKey:@"isVideo"]; [queryItemDict setObject:@"T" forKey:@"isVideo"];
[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];
}]; }];
}]; }];
} }
}else{ }else{
if ([fileManager fileExistsAtPath:tmpPath]==YES){ if ([fileManager fileExistsAtPath:tmpPath]==YES){
NSLog(@"EXISTTTTTTT");
NSMutableDictionary* queryItemDict = [NSMutableDictionary dictionary]; NSMutableDictionary* queryItemDict = [NSMutableDictionary dictionary];
[queryItemDict setObject:tmpPath forKey:@"path"]; [queryItemDict setObject:tmpPath forKey:@"path"];
[queryItemDict setObject:@"F" forKey:@"isVideo"]; [queryItemDict setObject:@"F" forKey:@"isVideo"];
[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];
}else{ }else{
int picWidth=[assets pixelWidth]; int picWidth=[assets pixelWidth];
...@@ -709,6 +700,7 @@ NSString *cacheDirectory; ...@@ -709,6 +700,7 @@ NSString *cacheDirectory;
NSMutableDictionary* queryItemDict = [NSMutableDictionary dictionary]; NSMutableDictionary* queryItemDict = [NSMutableDictionary dictionary];
[queryItemDict setObject:tmpPath forKey:@"path"]; [queryItemDict setObject:tmpPath forKey:@"path"];
[queryItemDict setObject:@"F" forKey:@"isVideo"]; [queryItemDict setObject:@"F" forKey:@"isVideo"];
[queryItemDict setObject:[NSString stringWithFormat:@"%ld", (long)[assets.creationDate timeIntervalSince1970]*1000] forKey:@"dataToken"];
// self.copySize++; // self.copySize++;
[self saveItemAndUpload:queryItemDict :assets :tmpPath :docName :resultId]; [self saveItemAndUpload:queryItemDict :assets :tmpPath :docName :resultId];
}]; }];
......
...@@ -16,6 +16,8 @@ Map<String, List<ScanImageItem>> changData(Map images) { ...@@ -16,6 +16,8 @@ Map<String, List<ScanImageItem>> changData(Map images) {
scanImageItem.realPath = item["realPath"] ?? ""; scanImageItem.realPath = item["realPath"] ?? "";
scanImageItem.isVideo = item["isVideo"] == "T" ? true : false; scanImageItem.isVideo = item["isVideo"] == "T" ? true : false;
scanImageItem.during = item["during"] ?? "0"; scanImageItem.during = item["during"] ?? "0";
scanImageItem.dataToken =
item["dataToken"] == null ? 0 : int.parse(item["dataToken"]);
tempList.add(scanImageItem); tempList.add(scanImageItem);
} }
newMap.putIfAbsent(k, () => tempList); newMap.putIfAbsent(k, () => tempList);
...@@ -51,5 +53,6 @@ class ScanImageItem { ...@@ -51,5 +53,6 @@ class ScanImageItem {
String realPath; String realPath;
String during; String during;
bool isVideo; bool isVideo;
int dataToken;
int size; int size;
} }
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