mirror of
https://github.com/greenshot/greenshot
synced 2025-08-20 21:43:24 -07:00
Merge 3a6172bea2
into c1ad1d4a93
This commit is contained in:
commit
dd3c28a6eb
1 changed files with 7 additions and 1 deletions
|
@ -610,6 +610,7 @@ EndSelection:<<<<<<<4
|
||||||
}
|
}
|
||||||
var fileFormatHandlers = SimpleServiceProvider.Current.GetAllInstances<IFileFormatHandler>();
|
var fileFormatHandlers = SimpleServiceProvider.Current.GetAllInstances<IFileFormatHandler>();
|
||||||
var supportedExtensions = fileFormatHandlers.ExtensionsFor(FileFormatHandlerActions.LoadDrawableFromStream).ToList();
|
var supportedExtensions = fileFormatHandlers.ExtensionsFor(FileFormatHandlerActions.LoadDrawableFromStream).ToList();
|
||||||
|
var foundContainer = false;
|
||||||
|
|
||||||
foreach (var (stream, filename) in IterateClipboardContent(dataObject))
|
foreach (var (stream, filename) in IterateClipboardContent(dataObject))
|
||||||
{
|
{
|
||||||
|
@ -622,7 +623,8 @@ EndSelection:<<<<<<<4
|
||||||
IEnumerable<IDrawableContainer> drawableContainers;
|
IEnumerable<IDrawableContainer> drawableContainers;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
drawableContainers = fileFormatHandlers.LoadDrawablesFromStream(stream, extension);
|
// without toList() here, LoadDrawablesFromStream() are called after the stream has been disposed
|
||||||
|
drawableContainers = fileFormatHandlers.LoadDrawablesFromStream(stream, extension).ToList();
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
@ -636,10 +638,14 @@ EndSelection:<<<<<<<4
|
||||||
// If we get here, there is an image
|
// If we get here, there is an image
|
||||||
foreach (var container in drawableContainers)
|
foreach (var container in drawableContainers)
|
||||||
{
|
{
|
||||||
|
foundContainer = true;
|
||||||
yield return container;
|
yield return container;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// we found sth., prevent multiple imports of the same content
|
||||||
|
if (foundContainer) yield break;
|
||||||
|
|
||||||
// check if files are supplied
|
// check if files are supplied
|
||||||
foreach (string imageFile in GetImageFilenames(dataObject))
|
foreach (string imageFile in GetImageFilenames(dataObject))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue