feature: export video to gallery for iOS

This commit is contained in:
2020-05-15 22:49:38 +08:00
parent 8ce5942662
commit 44ac3f5ba5
7 changed files with 215 additions and 11 deletions

View File

@@ -100,19 +100,19 @@ namespace Pixiview.Utils
}
}
public static ImageSource LoadUgoiraImage(string zip, string frame)
public static string LoadUgoiraImage(string zip, string frame)
{
var file = Path.Combine(PersonalFolder, ugoiraFolder, zip, frame);
if (File.Exists(file))
{
try
{
return ImageSource.FromFile(file);
}
catch (Exception ex)
{
App.DebugError("load.ugoira", $"failed to load ugoira frame: {zip}/{frame}, error: {ex.Message}");
}
//try
//{
return file;
//}
//catch (Exception ex)
//{
// App.DebugError("load.ugoira", $"failed to load ugoira frame: {zip}/{frame}, error: {ex.Message}");
//}
}
return null;
}
@@ -138,6 +138,11 @@ namespace Pixiview.Utils
}
}
public static string GetUgoiraVideoPath(string url)
{
return Path.Combine(PersonalFolder, ugoiraFolder, Path.GetFileNameWithoutExtension(url) + ".mp4");
}
private static T ReadObject<T>(string file)
{
string content = null;
@@ -397,6 +402,11 @@ namespace Pixiview.Utils
var file = Path.Combine(PersonalFolder, imageFolder, Path.GetFileName(url));
return File.Exists(file);
}
public static bool CheckUgoiraVideo(string url)
{
var file = Path.Combine(PersonalFolder, ugoiraFolder, Path.GetFileNameWithoutExtension(url) + ".mp4");
return File.Exists(file);
}
public static string GetPreviewImagePath(string url)
{