Skip to content

App crashes when reference and target images are different dimensions #2

@leikahing

Description

@leikahing

Issue by himekat from Friday Mar 14, 2014 at 18:18 GMT
Originally opened as https://github.com/mochify/renderly/issues/28


Description of Bug

If the target image is a different size (dimension-/pixel-wise) than the reference image, the app crashes with the one of the following exceptions (depending on the specific change):

Unhandled Exception: AForge.Imaging.InvalidImagePropertiesException: Template's size should be smaller or equal to source image's size.
   at AForge.Imaging.ExhaustiveTemplateMatching.ProcessImage(Bitmap image, Bitmap template, Rectangle searchZone)
   at Renderly.Imaging.ExhaustiveTemplateComparer.Matches(Bitmap reference, Bitmap compare) in f:\gitprojects\renderly\R
enderly\Imaging\ExhaustiveTemplateComparer.cs:line 32
   at Renderly.Controllers.RenderingController.RunTest(TestCase tc) in f:\gitprojects\renderly\Renderly\Controllers\Rend
eringController.cs:line 49
   at Renderly.Controllers.RenderingController.<RunTests>d__0.MoveNext() in f:\gitprojects\renderly\Renderly\Controllers
\RenderingController.cs:line 31
   at RenderlyApp.Commands.RunRenderingCommand.Run(String[] remainingArguments) in f:\gitprojects\renderly\RenderlyApp\C
ommands\RunRenderingCommand.cs:line 119
   at ManyConsole.ConsoleCommandDispatcher.DispatchCommand(IEnumerable`1 commands, String[] arguments, TextWriter consol
eOut, Boolean skipExeInExpectedUsage) in c:\src\ManyConsole\ManyConsole\ConsoleCommandDispatcher.cs:line 81
   at RenderlyApp.Program.Main(String[] args) in f:\gitprojects\renderly\RenderlyApp\Program.cs:line 35
Unhandled Exception: AForge.Imaging.InvalidImagePropertiesException: Overlay image size must be equal to source image si
ze.
   at AForge.Imaging.Filters.BaseInPlaceFilter2.ProcessFilter(UnmanagedImage image)
   at AForge.Imaging.Filters.BaseInPlaceFilter.Apply(BitmapData imageData)
   at AForge.Imaging.Filters.BaseInPlaceFilter.Apply(Bitmap image)
   at Renderly.Imaging.ExhaustiveTemplateComparer.GenerateDifferenceMap(Bitmap reference, Bitmap compare) in f:\gitproje
cts\renderly\Renderly\Imaging\ExhaustiveTemplateComparer.cs:line 60
   at Renderly.Controllers.RenderingController.RunTest(TestCase tc) in f:\gitprojects\renderly\Renderly\Controllers\Rend
eringController.cs:line 60
   at Renderly.Controllers.RenderingController.<RunTests>d__0.MoveNext() in f:\gitprojects\renderly\Renderly\Controllers
\RenderingController.cs:line 31
   at RenderlyApp.Commands.RunRenderingCommand.Run(String[] remainingArguments) in f:\gitprojects\renderly\RenderlyApp\C
ommands\RunRenderingCommand.cs:line 119
   at ManyConsole.ConsoleCommandDispatcher.DispatchCommand(IEnumerable`1 commands, String[] arguments, TextWriter consol
eOut, Boolean skipExeInExpectedUsage) in c:\src\ManyConsole\ManyConsole\ConsoleCommandDispatcher.cs:line 81
   at RenderlyApp.Program.Main(String[] args) in f:\gitprojects\renderly\RenderlyApp\Program.cs:line 35

Reproduction

  1. Begin with a test case that passes comparison.
  2. Modify the reference image to be slightly smaller than the target image.
  3. Run a comparison

    --It should fail with the above exception

Ideal Behavior

Ideally, the app won't crash, it will actually indicate the size difference in the report (by failing the test case).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions