Package geodress.exceptions

Examples of geodress.exceptions.NoMetaDataException


      GregorianCalendar resultCal = new GregorianCalendar();
      try {
        String time = getMetaDataReader().getData(
            InfoConstants.DATE_TIME);
        if (time == null) {
          throw new NoMetaDataException("no date/time found in "
              + getPath());
        }

        /* parse String to Date */
        SimpleDateFormat sdf = new SimpleDateFormat(
View Full Code Here


            }
          } else {
            logger.log(Level.FINER,
                "no meta data for latitude exist in "
                    + getFile().getPath());
            throw new NoMetaDataException(
                "no meta data for latitude exist in "
                    + getFile().getPath());
          }
        } catch (ImageReadException ire) {
          logger.log(Level.WARNING,
              "error while reading latitude from "
                  + file.getName(), ire);
        }
        break;
      case InfoConstants.GPS_LONGITUDE:
        try {
          if (jpegMetadata.getExif() != null
              && jpegMetadata.getExif().getGPS() != null) {
            value = String.valueOf(jpegMetadata.getExif().getGPS()
                .getLongitudeAsDegreesEast());
            if (jpegMetadata.getExif().getGPS().longitudeRef == GPSTagConstants.GPS_TAG_GPS_DEST_LONGITUDE_REF_VALUE_WEST) {
              value = "-" + value;
            }
          } else {
            logger.log(Level.FINER,
                "no meta data for longitude exist in "
                    + getFile().getPath());
            throw new NoMetaDataException(
                "no meta data for longitude exist in "
                    + getFile().getPath());
          }
        } catch (ImageReadException ire) {
          logger.log(Level.WARNING,
              "error while reading longitude from "
                  + file.getName(), ire);
        }
        break;
      case InfoConstants.DATE_TIME:
        /* format 'yyyy:MM:dd kk:mm:ss' */
        valueField = jpegMetadata
            .findEXIFValue(TiffConstants.EXIF_TAG_CREATE_DATE);
        if (valueField != null) {
          value = valueField.getValueDescription();
          value = value.substring(1, value.length() - 1);
        }
        break;
      case InfoConstants.USER_COMMENT:
        valueField = jpegMetadata
            .findEXIFValue(TiffConstants.EXIF_TAG_USER_COMMENT);
        if (valueField != null) {
          value = valueField.getValueDescription();
          value = value.substring(1, value.length() - 1);
        }
        break;
      case InfoConstants.IMAGE_DESCRIPTION:
        valueField = jpegMetadata
            .findEXIFValue(TiffConstants.TIFF_TAG_IMAGE_DESCRIPTION);
        if (valueField != null) {
          value = valueField.getValueDescription();
          value = value.substring(1, value.length() - 1);
        }
        break;
      }
    } else {
      logger.log(Level.FINER, "no meta data exist in "
          + getFile().getPath());
      throw new NoMetaDataException("no meta data exist in "
          + getFile().getPath());
    }
    return value;
  }
View Full Code Here

TOP

Related Classes of geodress.exceptions.NoMetaDataException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.