Browse Source

Remove processor exception wrapping. #1827

pull/1945/head
James Jackson-South 4 years ago
parent
commit
88e59a14aa
  1. 41
      src/ImageSharp/Processing/Processors/CloningImageProcessor{TPixel}.cs

41
src/ImageSharp/Processing/Processors/CloningImageProcessor{TPixel}.cs

@ -46,38 +46,25 @@ namespace SixLabors.ImageSharp.Processing.Processors
/// <inheritdoc/>
Image<TPixel> ICloningImageProcessor<TPixel>.CloneAndExecute()
{
try
{
Image<TPixel> clone = this.CreateTarget();
this.CheckFrameCount(this.Source, clone);
Image<TPixel> clone = this.CreateTarget();
this.CheckFrameCount(this.Source, clone);
Configuration configuration = this.Configuration;
this.BeforeImageApply(clone);
Configuration configuration = this.Configuration;
this.BeforeImageApply(clone);
for (int i = 0; i < this.Source.Frames.Count; i++)
{
ImageFrame<TPixel> sourceFrame = this.Source.Frames[i];
ImageFrame<TPixel> clonedFrame = clone.Frames[i];
for (int i = 0; i < this.Source.Frames.Count; i++)
{
ImageFrame<TPixel> sourceFrame = this.Source.Frames[i];
ImageFrame<TPixel> clonedFrame = clone.Frames[i];
this.BeforeFrameApply(sourceFrame, clonedFrame);
this.OnFrameApply(sourceFrame, clonedFrame);
this.AfterFrameApply(sourceFrame, clonedFrame);
}
this.BeforeFrameApply(sourceFrame, clonedFrame);
this.OnFrameApply(sourceFrame, clonedFrame);
this.AfterFrameApply(sourceFrame, clonedFrame);
}
this.AfterImageApply(clone);
this.AfterImageApply(clone);
return clone;
}
#if DEBUG
catch (Exception)
{
throw;
#else
catch (Exception ex)
{
throw new ImageProcessingException($"An error occurred when processing the image using {this.GetType().Name}. See the inner exception for more detail.", ex);
#endif
}
return clone;
}
/// <inheritdoc/>

Loading…
Cancel
Save