mirror of
https://github.com/greenshot/greenshot
synced 2025-08-20 13:33:27 -07:00
Fix for losing EXIF and other information, eventually causing the image to be incorrectly rotated.
This commit is contained in:
parent
7467720fe4
commit
63ecb20f9e
2 changed files with 16 additions and 8 deletions
|
@ -330,9 +330,7 @@ EndSelection:<<<<<<<4
|
||||||
LOG.Info("Using default .NET Clipboard.GetImage()");
|
LOG.Info("Using default .NET Clipboard.GetImage()");
|
||||||
try {
|
try {
|
||||||
returnImage = Clipboard.GetImage();
|
returnImage = Clipboard.GetImage();
|
||||||
if (returnImage != null) {
|
if (returnImage == null) {
|
||||||
return returnImage;
|
|
||||||
} else {
|
|
||||||
LOG.Info("Clipboard.GetImage() didn't return an image.");
|
LOG.Info("Clipboard.GetImage() didn't return an image.");
|
||||||
}
|
}
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
|
@ -345,13 +343,13 @@ EndSelection:<<<<<<<4
|
||||||
} else {
|
} else {
|
||||||
returnImage = GetImageFormat(currentFormat, dataObject);
|
returnImage = GetImageFormat(currentFormat, dataObject);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
LOG.DebugFormat("Couldn't find format {0}.", currentFormat);
|
||||||
|
}
|
||||||
if (returnImage != null) {
|
if (returnImage != null) {
|
||||||
ImageHelper.Orientate(returnImage);
|
ImageHelper.Orientate(returnImage);
|
||||||
return returnImage;
|
return returnImage;
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
LOG.DebugFormat("Couldn't find format {0}.", currentFormat);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
|
|
@ -1162,6 +1162,16 @@ namespace GreenshotPlugin.Core {
|
||||||
// Make sure both images have the same resolution
|
// Make sure both images have the same resolution
|
||||||
newImage.SetResolution(sourceImage.HorizontalResolution, sourceImage.VerticalResolution);
|
newImage.SetResolution(sourceImage.HorizontalResolution, sourceImage.VerticalResolution);
|
||||||
}
|
}
|
||||||
|
// Clone property items (EXIF information etc)
|
||||||
|
if (sourceImage.PropertyItems != null) {
|
||||||
|
foreach (var propertyItem in sourceImage.PropertyItems) {
|
||||||
|
try {
|
||||||
|
newImage.SetPropertyItem(propertyItem);
|
||||||
|
} catch (Exception ex) {
|
||||||
|
LOG.Warn("Problem cloning a propertyItem.", ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
return newImage;
|
return newImage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue