Page MenuHomePhabricator

Crash when opening png/jpeg as first image in a project
Closed, ResolvedPublic

Description

To reproduce:

  1. Start MITK Workbench
  2. Drag and drop a jpg/jpeg/png file onto the multiwidget

-> Crash

By comparison

  1. same

1a. Drag and drop a .nrrd file

  1. same

-> No Crash

Event Timeline

Works on Linux. Stack trace?

No crashes here.

On my Windows machine it gracefully says in a message box that it has no reader available for JPG/JPEG. PNGs are working.

Okay, it seems the reproduction is not quite as easy to do:

  1. Start MITK Workbench
  2. Open "Viewer" Perspective (No View open, just the multiwidget)
  3. Close the application
  4. Start MITK Workbench
  5. Drag and drop jpeg etc.

-> Crash

Access violation in mitkImage.cpp line 148

double returnvalue = (((T*) data)[rgboffset ]);

Besides the crash, this reveals (reminds me of) another issue. Should we match known files extensions in a case insensitive way to file names?

I would imagine that loading "jpeg" files works, but "JPEG" doesn't currently (even on Windows).

Is there a reason not to? Off the top of my head I do not know any format where different capitalization is a different format.

Agree, insensitive. Many programs don't even use case consistently in file endings.

Crash fixed in T18110.

Case insensitive extension matching implemented in T14866.

All merged to master.