find not displayable images

find not displayable images

/* JAlbum tool to find not displayable images (files that can't be displayed/shown, e.g. pdf files). 
 * Place this file in the tools folder of your jAlbum directory. 
 * To start this program select the "Tools" pull down menu in jAlbum, then select "External Tools" and then select this program.

import se.datadosen.jalbum.*;
import se.datadosen.explorer.*;
import se.datadosen.util.IO;

int repaired = 0;

void findNotDisplayableImages(AlbumObject folder) throws IOException {
	File link;
	String path;
	ArrayList all = folder.getChildren();
	for (AlbumObject ao : all) {

		if ( !ao.hasDisplayableImage() && !ao.isFolder() && ao.isIncluded() ) {
			link = ao.getFile();
		if ( ao.isFolder() && ao.isIncluded() ) {
void processAlbum() {
	System.err.println("Starting search for not displayable images or movies");
	try {
	} catch(IOException e) {
	System.err.println("Search for not displayable images or movies finished");
	JOptionPane.showConfirmDialog(window, new Object[] { 
			new JLabel(((repaired > 0)? (repaired.toString() + " not displayable images or movies have been found. See java system console \"F7\" for details.") : "No not displayable images or movies have been found."))
		"Finished searching", JOptionPane.DEFAULT_OPTION);

// Execution starts here


Usage: copy the text above in a file with the extension ".bsh". Put this file in the tools folder of jAlbum. After next start of jAlbum, you will find the file in the Tools -> external Tools section.