#! /usr/bin/perl

use Gimp;
use Gimp::Fu;

register "cory_jpginfo",
         "test width and height of image",
         "test width and height of image",
         "Cory Petkovsek",
         "Public Domain", 
         "5/10/01",
         "<Toolbox>/Xtns/Script-Fu/Cory/",
         "",  # RGB*
         [],

         sub {


	    $dir = shift || '.';

	    opendir DIR, $dir or die "Can't open directory $dir: $!\n";

	    @files= grep /[pP].+\.jpg/, readdir(DIR);
	    for($i=0; $i<=$#files; $i++){
		my $image = Gimp->file_jpeg_load("/home/cory/item/".$files[$i],0);
		my $width = Gimp->gimp_image_width($image);
		my $height = Gimp->gimp_image_height($image);
		if (($width!=1024) || ($height!=768) ){	
		    print $files[$i].": ".$width."x".$height."\n";
		    }
		}
	     return;
	 };

exit main;
