NOTICE! This is a static HTML version of a legacy ImageJ Trac ticket.

The ImageJ project now uses GitHub Issues for issue tracking.

Please file all new issues there.

Ticket #532 (closed defect: fixed)

Opened 2011-05-20T14:11:42-05:00

Last modified 2012-02-24T16:51:36-06:00

Make legacy layer smarter about handling new IJ2 data types

Reported by: bdezonia Owned by: bdezonia
Priority: major Milestone: biweekly-2011: May-23 to Jun-03
Component: Legacy Compatibility Version:
Severity: serious Keywords:
Cc: Blocked By:
Blocking: #1011

Description

Freshly start IJ2. Create a gradient image that is 12-bit. Run the Image :: Transform :: Rotate IJ1 plugin. What happens?

Waiting for #529 to be fixed before this scenario may work.

Change History

comment:1 Changed 2011-05-24T10:39:38-05:00 by bdezonia

After 529 fix running this sequence results in an exception:

Exception in thread "PluginRunner-imagej.legacy.plugin.LegacyPlugin" java.lang.ArrayIndexOutOfBoundsException

at java.lang.System.arraycopy(Native Method)
at ij.process.ColorProcessor.snapshot(ColorProcessor.java:187)
at ij.plugin.filter.PlugInFilterRunner.<init>(PlugInFilterRunner.java:98)
at ij.IJ.runPlugIn(IJ.java:158)
at ij.IJ.runPlugIn(IJ.java:139)
at imagej.legacy.plugin.LegacyPlugin.run(LegacyPlugin.java:104)
at imagej.plugin.PluginRunner.run(PluginRunner.java:81)
at imagej.plugin.PluginManager$1.run(PluginManager.java:131)
at java.lang.Thread.run(Thread.java:680)

Unsigned 12-bit is stored internally as pixel values packed in an array of ints. Thus IJ1 thinks its a color image and the array size is not appropriate.

I think what we really need to do is detect that this type not representable in IJ1 and avoid actually running plugin (informing user). Or else ask if user wants best attempt and translating the data into an IJ1 type.

comment:2 Changed 2011-05-24T10:41:03-05:00 by bdezonia

  • Summary changed from Test this scenario to Make legacy layer smarter about handling new IJ2 data types

comment:3 Changed 2011-05-26T14:21:54-05:00 by bdezonia

  • Status changed from new to closed
  • Resolution set to fixed

Fixed (revision unknown but shortly before 0caeefd22661dc1682e264477970144c564f5b97). The legacy layer now translates all data types back and forth between IJ1 as needed.

comment:4 Changed 2012-02-24T16:51:36-06:00 by curtis

  • Blocking 1011 added