mirror of
https://github.com/crskycode/GARbro.git
synced 2026-07-08 01:30:18 +08:00
consider empty IResource.Extensions property.
This commit is contained in:
@@ -89,7 +89,7 @@ namespace GARbro.GUI
|
|||||||
var filters = new StringBuilder();
|
var filters = new StringBuilder();
|
||||||
|
|
||||||
var format = this.ArchiveFormat.SelectedItem as ArchiveFormat;
|
var format = this.ArchiveFormat.SelectedItem as ArchiveFormat;
|
||||||
if (null != format)
|
if (null != format && format.Extensions.Any())
|
||||||
{
|
{
|
||||||
var patterns = format.Extensions.Select (ext => "*."+ext);
|
var patterns = format.Extensions.Select (ext => "*."+ext);
|
||||||
filters.Append (format.Description);
|
filters.Append (format.Description);
|
||||||
|
|||||||
@@ -194,7 +194,7 @@ namespace GARbro.GUI
|
|||||||
string source_ext = Path.GetExtension (filename).TrimStart ('.').ToLowerInvariant();
|
string source_ext = Path.GetExtension (filename).TrimStart ('.').ToLowerInvariant();
|
||||||
if (m_image_format.Extensions.Any (ext => ext == source_ext))
|
if (m_image_format.Extensions.Any (ext => ext == source_ext))
|
||||||
return;
|
return;
|
||||||
string target_ext = m_image_format.Extensions.First();
|
string target_ext = m_image_format.Extensions.FirstOrDefault();
|
||||||
string target_name = Path.ChangeExtension (filename, target_ext);
|
string target_name = Path.ChangeExtension (filename, target_ext);
|
||||||
using (var file = File.OpenRead (filename))
|
using (var file = File.OpenRead (filename))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -312,7 +312,7 @@ namespace GARbro.GUI
|
|||||||
if (null == src_format)
|
if (null == src_format)
|
||||||
throw new InvalidFormatException (string.Format ("{1}: {0}", guiStrings.MsgUnableInterpretImage, entry.Name));
|
throw new InvalidFormatException (string.Format ("{1}: {0}", guiStrings.MsgUnableInterpretImage, entry.Name));
|
||||||
file.Position = 0;
|
file.Position = 0;
|
||||||
string target_ext = target_format.Extensions.First();
|
string target_ext = target_format.Extensions.FirstOrDefault() ?? "";
|
||||||
string outname = FindUniqueFileName (entry.Name, target_ext);
|
string outname = FindUniqueFileName (entry.Name, target_ext);
|
||||||
if (src_format.Item1 == target_format)
|
if (src_format.Item1 == target_format)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user