private void loadFromFile(File f) throws ImageProcessingException,
			IOException {

		filename = f.getName();

		filepath = f.getParent();
		filesize = f.length();
		filedate = f.lastModified();

		Metadata metadata = ImageMetadataReader.readMetadata(f);
		Directory directory = metadata.getDirectory(ExifSubIFDDirectory.class);
		imagedate = directory
				.getDate(ExifSubIFDDirectory.TAG_DATETIME_ORIGINAL).getTime();
		directory = metadata.getDirectory(JpegDirectory.class);
		try {
			imagewidth = directory.getInt(JpegDirectory.TAG_JPEG_IMAGE_WIDTH);
			imageheight = directory.getInt(JpegDirectory.TAG_JPEG_IMAGE_HEIGHT);
		} catch (MetadataException e) {
			directory = metadata.getDirectory(ExifSubIFDDirectory.class);
			try {
				imagewidth = directory
						.getInt(ExifSubIFDDirectory.TAG_EXIF_IMAGE_WIDTH);
				imageheight = directory
						.getInt(ExifSubIFDDirectory.TAG_EXIF_IMAGE_HEIGHT);
			} catch (MetadataException e1) {
				// TODO Auto-generated catch block
				e.printStackTrace();
				e1.printStackTrace();
			}
		}
	}