/**
  * Get a thumbnail.
  *
  * <p>If not available the image is created.
  */
 public synchronized Image getImage(PM_Picture picture, boolean toImport) {
   File fileOriginal = picture.getFileOriginal();
   File fileThumbnail = PM_Utils.getFileThumbnail(fileOriginal);
   // The thumbnail file is available.
   if (fileThumbnail.isFile()) {
     return readImageThumbnail(fileThumbnail);
   }
   // The thumb nail file is NOT available.
   if (toImport) {
     //			return readThumbAsIcon(picture, fileOriginal, fileThumbnail);
   }
   return readThumb(picture, fileThumbnail);
 };
  // =====================================================
  // setEXIFpictureMetadaten()
  //
  // Aus dem Image-Original werden die EXIF-Daten f�r die
  // PM_PictureMetadatenX geholt und eingetragen
  // =====================================================
  public static void setEXIFpictureMetadaten(PM_Picture picture) {

    PM_PictureImageMetadaten imageMetadaten = picture.getImageMetadaten();

    // ----------------------------------------------------
    // FujiFilm Makernote:  SequenceNummer --> virtPicture
    // ----------------------------------------------------

    // -------------------------------------------------------
    // Date
    // ------------------------------------------------------

    String tagDatum = "Date/Time Original";
    String description = "";
    if (imageMetadaten.hasTag(tagDatum)) {
      description = imageMetadaten.getDescription(tagDatum);
    }

    // ----------------------------------------------------
    // Datum nicht vorhanden oder ung�ltig
    // ----------------------------------------------------
    Date myDate = null;
    if (description.length() == 0 || description.equals("0000:00:00 00:00:00")) {
      //			  System.out.println("......  Datum = " + description + " kann nicht konvertiert
      // werden");
      File f = picture.getFileOriginal();
      Date date = new Date(f.lastModified());
      picture.meta.setDateImport(date);
      picture.meta.setDateCurrent(new Date(date.getTime()));
      return;
    }

    // ----------------------------------------------------
    // g�ltiges Datum gefunden
    // ----------------------------------------------------
    DateFormat df = new SimpleDateFormat("yyyy:MM:dd HH:mm:ss");
    try {
      myDate = df.parse(description);
    } catch (ParseException e) {
      //           System.out.println("ParseException fuer Datum = " + description);
      myDate = new Date(System.currentTimeMillis()); // default
    }
    picture.meta.setDateImport(myDate);
    picture.meta.setDateCurrent(new Date(myDate.getTime()));
  }
  /** Read the thumbnail */
  private Image readImageThumbnail(File fileThumbnail) {

    Image image = null;

    try {
      image = Toolkit.getDefaultToolkit().getImage(fileThumbnail.getPath());
      MediaTracker mediaTracker = new MediaTracker(new Container());
      mediaTracker.addImage(image, 0);
      mediaTracker.waitForID(0);
    } catch (InterruptedException e) {
      //			System.out.println("ERROR: InterruptedException beim Lesen thumbnail (" +
      // fileThumbnail.getPath()
      //					+ "). " + e);
      return null;
    }

    return image;
  }