This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
ImageDataLoader.findPrimaryFile method is inefficient. It asks JavaIO API for ImageReader when a file without extension that is known to be image is encountered. I am not sure if we can write good MIME resolver but at least it should be possible to cache extensions that do not have image readers so that imageio is not queried repeatedly.
fixed in the main trunk: caching of extensions added, thanks for hint. QA try to open some images with different extensions (.jpg, .gif...) Index: src/org/netbeans/modules/image/ImageDataLoader.java =================================================================== RCS file: /cvs/image/src/org/netbeans/modules/image/ImageDataLoader.java,v retrieving revision 1.25 diff -r1.25 ImageDataLoader.java 17a18,19 > import java.util.HashSet; > import java.util.Set; 39a42,43 > private static Set notSupportedExtensions = new HashSet (); > 70,74c74,82 < Iterator it = javax.imageio.ImageIO.getImageReadersBySuffix(ext); < if( it.hasNext() ){ < /* Use the first available ImageIO loader */ < retValue = fo; < getExtensions().addExtension(ext); --- > > if (!notSupportedExtensions.contains (ext)) { > Iterator it = javax.imageio.ImageIO.getImageReadersBySuffix(ext); > if( it.hasNext() ){ > /* Use the first available ImageIO loader */ > retValue = fo; > getExtensions().addExtension(ext); > } else > notSupportedExtensions.add (ext);
Thanks, time spent in ImageDataLoader is significantly reduced now.