public FileMetadata(PayloadContainer source, String filename, String mimeType, String description,
			Id3PictureType picType, byte[] fileData) {
		super();
		this.source = source;
		this.filename = filename;
		this.mimeType = mimeType;
		this.description = description;

		// if file contents are supplied, store size/crc
		if(fileData != null) {
			this.scanFileData(fileData);
		}

		// if this is an image file, try to load it 
		if(ImageAttributes.isImageMimeType(mimeType) || picType!=null) {
			if(fileData == null) {
				try {
					fileData = source.getPayload();
				} catch (IOException e) {
					// TODO log (get log owner?)
					fileData = null;
					this.fileSize = -1;
					this.crc32 = null;
					this.imageAttributes = null;
				}
				if(fileData!=null) {
					this.scanFileData(fileData);
				}
			}
			
			if(fileData != null) {
				this.imageAttributes = new ImageAttributes(picType,fileData);				
			}
		}
	}