ImageImplRegistry registry = manager.getRegistry();
if (registry.getImageConverterModifications() != converterEdgeDirectoryVersion) {
Collection converters = registry.getImageConverters();
//Rebuild edge directory
DefaultEdgeDirectory dir = new DefaultEdgeDirectory();
Iterator iter = converters.iterator();
while (iter.hasNext()) {
ImageConverter converter = (ImageConverter)iter.next();
Penalty penalty = Penalty.toPenalty(converter.getConversionPenalty());
penalty = penalty.add(
registry.getAdditionalPenalty(converter.getClass().getName()));
dir.addEdge(new ImageConversionEdge(converter, penalty));
}
converterEdgeDirectoryVersion = registry.getImageConverterModifications();
this.converterEdgeDirectory = dir; //Replace (thread-safe)
}