public static BitmapSource[] GetMapImages(MapInfo map)
{
var swf = map.ToSwf();
var frame = swf?.Tags.SkipWhile(x => x.TagType != TagType.ShowFrame).ToArray();
var jpeg3 = frame
.OfType<DefineBitsTag>()
.Where(x => x.TagType == TagType.DefineBitsJPEG3)
.Select(x => x.ToBitmapFrame());
var lossless2 = frame
.OfType<DefineBitsLosslessTag>()
.Where(x => x.TagType == TagType.DefineBitsLossless2)
.Select(x => x.ToBitmapFrame());
return jpeg3.Concat(lossless2)
.Where(x => x != null)
.Where(x => x.PixelWidth == 768)
.ToArray();
}