Package org.apache.sanselan.formats.tiff

Examples of org.apache.sanselan.formats.tiff.TiffField$OversizeValueElement


      Object o = items.get(i);
      if (!(o instanceof TiffImageMetadata.Item))
        continue;

      TiffImageMetadata.Item item = (TiffImageMetadata.Item) o;
      TiffField field = item.getTiffField();
      if (field.tag == tagInfo.tag)
        return field;
    }

    return null;
View Full Code Here


                    byteSource, params);

            if (metadata != null)
            {
                {
                    TiffField field = metadata
                            .findEXIFValue(TIFF_TAG_XRESOLUTION);
                    if (field != null)
                        x_density = ((Number) field.getValue()).doubleValue();
                }
                {
                    TiffField field = metadata
                            .findEXIFValue(TIFF_TAG_YRESOLUTION);
                    if (field != null)
                        y_density = ((Number) field.getValue()).doubleValue();
                }
                {
                    TiffField field = metadata
                            .findEXIFValue(TIFF_TAG_RESOLUTION_UNIT);
                    if (field != null)
                    {
                        int density_units = ((Number) field.getValue())
                                .intValue();

                        switch (density_units)
                        {
                        case 1:
View Full Code Here

    public JpegPhotoshopMetadata getPhotoshop() {
        return photoshop;
    }

    public TiffField findEXIFValue(TagInfo tagInfo) {
        TiffField field = findEXIFValue(tagInfo, true);
        if (field == null) {
            // In some cases, we want an exact directory match (such as GPS values).
            // In other cases, we are more permissive (ie. with tags that may appear
            // in a number of different directories, depending on the camera manufacturer, etc.
            // TODO: Modify TagInfo class to include a "permissive/exact" flag.
View Full Code Here

            Object o = items.get(i);
            if (!(o instanceof TiffImageMetadata.Item))
                continue;

            TiffImageMetadata.Item item = (TiffImageMetadata.Item) o;
            TiffField field = item.getTiffField();
            if (requireDirectoryMatch &&
                    (field.directoryType != tagInfo.directoryType.directoryType)) {
                continue;
            }
            if (field.tag == tagInfo.tag)
View Full Code Here

            codecV = "jpg";
            IImageMetadata meta = Sanselan.getMetadata(file);

            if (meta != null && meta instanceof JpegImageMetadata) {
              JpegImageMetadata jpegmeta = (JpegImageMetadata) meta;
              TiffField tf = jpegmeta.findEXIFValue(TiffConstants.EXIF_TAG_MODEL);

              if (tf != null) {
                model = tf.getStringValue().trim();
              }

              tf = jpegmeta.findEXIFValue(TiffConstants.EXIF_TAG_EXPOSURE_TIME);
              if (tf != null) {
                exposure = (int) (1000 * tf.getDoubleValue());
              }

              tf = jpegmeta.findEXIFValue(TiffConstants.EXIF_TAG_ORIENTATION);
              if (tf != null) {
                orientation = tf.getIntValue();
              }

              tf = jpegmeta.findEXIFValue(TiffConstants.EXIF_TAG_ISO);
              if (tf != null) {
                // Galaxy Nexus jpg pictures may contain multiple values, take the first
                int[] isoValues = tf.getIntArrayValue();
                iso = isoValues[0];
              }
            }
          } else if (formatName.startsWith("PNG")) {
            codecV = "png";
View Full Code Here

                    byteSource, params);

            if (metadata != null)
            {
                {
                    TiffField field = metadata
                            .findEXIFValue(TIFF_TAG_XRESOLUTION);
                    if (field != null)
                        x_density = ((Number) field.getValue()).doubleValue();
                }
                {
                    TiffField field = metadata
                            .findEXIFValue(TIFF_TAG_YRESOLUTION);
                    if (field != null)
                        y_density = ((Number) field.getValue()).doubleValue();
                }
                {
                    TiffField field = metadata
                            .findEXIFValue(TIFF_TAG_RESOLUTION_UNIT);
                    if (field != null)
                    {
                        int density_units = ((Number) field.getValue())
                                .intValue();

                        switch (density_units)
                        {
                        case 1:
View Full Code Here

    public JpegPhotoshopMetadata getPhotoshop() {
        return photoshop;
    }

    public TiffField findEXIFValue(TagInfo tagInfo) {
        TiffField field = findEXIFValue(tagInfo, true);
        if (field == null) {
            // In some cases, we want an exact directory match (such as GPS values).
            // In other cases, we are more permissive (ie. with tags that may appear
            // in a number of different directories, depending on the camera manufacturer, etc.
            // TODO: Modify TagInfo class to include a "permissive/exact" flag.
View Full Code Here

            Object o = items.get(i);
            if (!(o instanceof TiffImageMetadata.Item))
                continue;

            TiffImageMetadata.Item item = (TiffImageMetadata.Item) o;
            TiffField field = item.getTiffField();
            if (requireDirectoryMatch &&
                    (field.directoryType != tagInfo.directoryType.directoryType)) {
                continue;
            }
            if (field.tag == tagInfo.tag)
View Full Code Here

                elements.add(directory);

                List fields = directory.getDirectoryEntrys();
                for (int f = 0; f < fields.size(); f++)
                {
                    TiffField field = (TiffField) fields.get(f);
                    TiffElement oversizeValue = field.getOversizeValueElement();
                    if (oversizeValue != null)
                        elements.add(oversizeValue);

                }
View Full Code Here

  {
    Hashtable fieldMap = new Hashtable();
    for (int i = 0; i < items.size(); i++)
    {
      TiffImageMetadata.Item item = (TiffImageMetadata.Item) items.get(i);
      TiffField field = item.getTiffField();
      Object key = new Integer(field.tag);
      if (!fieldMap.containsKey(key))
        fieldMap.put(key, field);
    }
    return fieldMap;
View Full Code Here

TOP

Related Classes of org.apache.sanselan.formats.tiff.TiffField$OversizeValueElement

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.