Skip to content

Commit 6c25c68

Browse files
authored
Merge pull request #4040 from sbesson/lurawave_removal
Remove support for proprietary LuraWave license
2 parents 65db5eb + 1b16e9a commit 6c25c68

File tree

23 files changed

+10
-704
lines changed

23 files changed

+10
-704
lines changed

.classpath-template

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
<classpathentry kind="src" path="components/formats-bsd/src"/>
77
<classpathentry kind="src" path="components/formats-gpl/build/src"/>
88
<classpathentry kind="src" path="components/formats-gpl/src"/>
9-
<classpathentry kind="src" path="components/stubs/lwf-stubs/build/src"/>
10-
<classpathentry kind="src" path="components/stubs/lwf-stubs/src"/>
119
<classpathentry kind="src" path="components/test-suite/build/src"/>
1210
<classpathentry kind="src" path="components/test-suite/src"/>
1311
<classpathentry kind="src" path="components/formats-api/test"/>

build.xml

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ Bio-Formats
1616
JAR file: bio-formats.jar
1717
Path: components/bio-formats
1818
Project deps: Formats Common, OME-XML Java library, JAI Image I/O Tools,
19-
MDB Tools (Java port), Apache Jakarta POI,
20-
Luratech LuraWave stubs
19+
MDB Tools (Java port), Apache Jakarta POI
2120
Library deps: JGoodies Forms, Logback, NetCDF,
2221
Simple Logging Facade for Java API, TestNG
2322
Optional: Xalan Serializer, Xalan
@@ -76,21 +75,6 @@ JAI Image I/O Tools
7675
This component will be removed once our changes have been
7776
added to the official JAI CVS repository.
7877
79-
===============================================================================
80-
The following components are stubs of third party projects:
81-
82-
Luratech LuraWave stubs
83-
Stub of proprietary Java API to handle Luratech LWF compression
84-
-=-
85-
JAR file: lwf-stubs.jar
86-
Path: components/stubs/lwf-stubs
87-
Project deps: (none)
88-
Optional: (none)
89-
License: BSD
90-
Project URL: http://www.luratech.com/
91-
Notes: required to compile Bio-Formats's support for Luratech LWF
92-
compression for the Opera Flex format
93-
9478
===============================================================================
9579
The following external dependencies (in the jar folder) may be required:
9680
Ant-Contrib

components/bio-formats-plugins/src/loci/plugins/config/FlexWidgets.java

Lines changed: 0 additions & 120 deletions
This file was deleted.

components/bio-formats-plugins/src/loci/plugins/config/libraries.txt

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -261,11 +261,3 @@ url = http://www.loci.wisc.edu/software/ome-notes
261261
license = GPL
262262
notes = OME Notes library for flexible organization and presentation
263263
of OME-XML metadata.
264-
265-
[LuraWave decoder SDK]
266-
type = Java library
267-
class = com.luratech.lwf.lwfDecoder
268-
url = http://www.luratech.com/
269-
license = Commercial
270-
notes = Used by Bio-Formats to decode Flex files
271-
compressed with the LuraWave JPEG2000 codec.

components/bio-formats-plugins/src/loci/plugins/in/ImagePlusReader.java

Lines changed: 7 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@
6060
import loci.plugins.util.BFVirtualStack;
6161
import loci.plugins.util.ImageProcessorReader;
6262
import loci.plugins.util.LociPrefs;
63-
import loci.plugins.util.LuraWave;
6463
import loci.plugins.util.VirtualImagePlus;
6564
import ome.units.UNITS;
6665
import ome.units.quantity.Time;
@@ -385,7 +384,13 @@ private ImageStack readPlanes(ImportProcess process, int s, List<LUT> luts,
385384
updateTiming(s, current, current++, total);
386385

387386
// get image processor for ith plane
388-
final ImageProcessor[] p = readProcessors(process, i, region, thumbnail);
387+
ImageProcessor[] p;
388+
if (thumbnail) {
389+
p = reader.openThumbProcessors(i);
390+
} else {
391+
p = reader.openProcessors(i, region.x, region.y, region.width, region.height);
392+
}
393+
389394
if (p == null || p.length == 0) {
390395
throw new FormatException("Cannot read plane #" + i);
391396
}
@@ -401,40 +406,6 @@ private ImageStack readPlanes(ImportProcess process, int s, List<LUT> luts,
401406
return createStack(procs, labels, luts);
402407
}
403408

404-
/**
405-
* HACK: This method mainly exists to prompt the user for a missing
406-
* LuraWave license code, in the case of LWF-compressed Flex.
407-
*
408-
* @see ImportProcess#setId()
409-
*/
410-
private ImageProcessor[] readProcessors(ImportProcess process,
411-
int no, Region r, boolean thumbnail) throws FormatException, IOException
412-
{
413-
final ImageProcessorReader reader = process.getReader();
414-
final ImporterOptions options = process.getOptions();
415-
416-
boolean first = true;
417-
for (int i=0; i<LuraWave.MAX_TRIES; i++) {
418-
String code = LuraWave.initLicenseCode();
419-
try {
420-
if (thumbnail) {
421-
return reader.openThumbProcessors(no);
422-
}
423-
return reader.openProcessors(no, r.x, r.y, r.width, r.height);
424-
}
425-
catch (FormatException exc) {
426-
if (options.isQuiet() || options.isWindowless()) throw exc;
427-
if (!LuraWave.isLicenseCodeException(exc)) throw exc;
428-
429-
// prompt user for LuraWave license code
430-
code = LuraWave.promptLicenseCode(code, first);
431-
if (code == null) throw exc;
432-
if (first) first = false;
433-
}
434-
}
435-
throw new FormatException(LuraWave.TOO_MANY_TRIES);
436-
}
437-
438409
// -- Helper methods - image post processing --
439410

440411
private List<ImagePlus> concatenate(List<ImagePlus> imps) {

components/bio-formats-plugins/src/loci/plugins/in/ImportProcess.java

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@
6262
import loci.plugins.BF;
6363
import loci.plugins.util.ImageProcessorReader;
6464
import loci.plugins.util.LociPrefs;
65-
import loci.plugins.util.LuraWave;
6665
import loci.plugins.util.VirtualReader;
6766
import loci.plugins.util.WindowTools;
6867
import ome.xml.model.enums.DimensionOrder;
@@ -544,7 +543,7 @@ private void initializeStack() throws FormatException, IOException {
544543
baseReader.getMetadataOptions().setMetadataLevel(
545544
MetadataLevel.NO_OVERLAYS);
546545
}
547-
setId();
546+
reader.setId(options.getId());
548547

549548
computeSeriesLabels(reader);
550549
}
@@ -687,34 +686,6 @@ private void saveDefaults() {
687686

688687
// -- Helper methods -- ImportStep.STACK --
689688

690-
/**
691-
* HACK: This method mainly exists to prompt the user for a missing
692-
* LuraWave license code, in the case of LWF-compressed Flex.
693-
*
694-
* @see ImagePlusReader#readProcessors(ImportProcess, int, Region, boolean)
695-
*/
696-
private void setId() throws FormatException, IOException {
697-
boolean first = true;
698-
for (int i=0; i<LuraWave.MAX_TRIES; i++) {
699-
String code = LuraWave.initLicenseCode();
700-
try {
701-
reader.setId(options.getId());
702-
return;
703-
}
704-
catch (FormatException exc) {
705-
if (options.isQuiet() || options.isWindowless()) throw exc;
706-
if (!LuraWave.isLicenseCodeException(exc)) throw exc;
707-
708-
// prompt user for LuraWave license code
709-
code = LuraWave.promptLicenseCode(code, first);
710-
if (code == null) throw exc;
711-
if (first) first = false;
712-
reader.close();
713-
}
714-
}
715-
throw new FormatException(LuraWave.TOO_MANY_TRIES);
716-
}
717-
718689
private void computeSeriesLabels(IFormatReader r) {
719690
final int seriesCount = r.getSeriesCount();
720691
seriesLabels = new String[seriesCount];

components/bio-formats-plugins/src/loci/plugins/util/LuraWave.java

Lines changed: 0 additions & 89 deletions
This file was deleted.

components/bundles/bioformats_package/pom.xml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,6 @@
4040
<version>${project.version}</version>
4141
</dependency>
4242

43-
<dependency>
44-
<groupId>org.openmicroscopy</groupId>
45-
<artifactId>lwf-stubs</artifactId>
46-
<version>${lwf-stubs.version}</version>
47-
<scope>provided</scope>
48-
</dependency>
49-
5043
<dependency>
5144
<groupId>org.openmicroscopy</groupId>
5245
<artifactId>mipav-stubs</artifactId>

0 commit comments

Comments
 (0)