Examples of TiffOutputField


Examples of org.apache.commons.imaging.formats.tiff.write.TiffOutputField

                    // "\t" + "unknown tag(0x"
                    // + Integer.toHexString(srcField.tag)
                    // + ") bytes", bytes);

                    final int count = bytes.length / fieldType.getSize();
                    final TiffOutputField dstField = new TiffOutputField(
                            srcField.getTag(), tagInfo, fieldType, count, bytes);
                    dstField.setSortHint(srcField.getSortHint());
                    dstDir.add(dstField);
                }

                dstDir.setTiffImageData(getTiffImageData());
                dstDir.setJpegImageData(getJpegImageData());
View Full Code Here

Examples of org.apache.sanselan.formats.tiff.write.TiffOutputField

                // directories are associated with a given tag.
                //
                // see
                // org.apache.sanselan.formats.tiff.constants.AllTagConstants
                //
                TiffOutputField aperture = TiffOutputField.create(
                        TiffConstants.EXIF_TAG_APERTURE_VALUE,
                        outputSet.byteOrder, new Double(0.3));
                TiffOutputDirectory exifDirectory = outputSet
                        .getOrCreateExifDirectory();
                // make sure to remove old value if present (this method will
View Full Code Here

Examples of org.apache.sanselan.formats.tiff.write.TiffOutputField

                    //                        Debug.debug(
                    //                                "\t" + "unknown tag(0x"
                    //                                        + Integer.toHexString(srcField.tag)
                    //                                        + ") bytes", bytes);

                    TiffOutputField dstField = new TiffOutputField(
                            srcField.tag, tagInfo, fieldType, count, bytes);
                    dstField.setSortHint(srcField.getSortHint());
                    dstDir.add(dstField);
                }

                dstDir.setTiffImageData(getTiffImageData());
                dstDir.setJpegImageData(getJpegImageData());
View Full Code Here

Examples of org.apache.sanselan.formats.tiff.write.TiffOutputField

    public boolean writeExifGpsInfo(File jpeg, Wpt wpt, boolean overwrite){
        try{
            TiffOutputSet outputSet = SanselanExifWriter.getExif(jpeg);
            outputSet.setGPSInDegrees(wpt.getLon().doubleValue(), wpt.getLat().doubleValue());
            TiffOutputDirectory gpsIfd = outputSet.getGPSDirectory();
            TiffOutputField field;
            final int byteOrder = outputSet.byteOrder;

            /* version */
            field = makeField(
                TiffConstants.GPS_TAG_GPS_VERSION_ID,
View Full Code Here

Examples of org.apache.sanselan.formats.tiff.write.TiffOutputField

            return false;
        }
    }

    private static TiffOutputField makeField(TagInfo tag, byte[] bytes){
        return new TiffOutputField(tag, tag.dataTypes[0], tag.length, bytes);
    }
View Full Code Here

Examples of org.apache.sanselan.formats.tiff.write.TiffOutputField

    private static TiffOutputField makeField(TagInfo tag, byte[] bytes){
        return new TiffOutputField(tag, tag.dataTypes[0], tag.length, bytes);
    }

    private static TiffOutputField makeField(TagInfo tag, int byteOrder, String str) throws ImageWriteException{
        return new TiffOutputField(tag, tag.dataTypes[0], str.length() + 1,
            tag.dataTypes[0].writeData(str + (char) 0, byteOrder));
    }
View Full Code Here

Examples of org.apache.sanselan.formats.tiff.write.TiffOutputField

      }

      /* iterate all fields to save and store them into the TiffOutputSet */
      for (TagInfo field : saveMap.keySet()) {
        /* remove the field if it already exists */
        TiffOutputField metadataField = exifTags.findField(field);
        if (metadataField != null) {
          exifTags.removeField(field);
        }

        TiffOutputField outputField = new TiffOutputField(field.tag,
            field, TiffFieldTypeConstants.FIELD_TYPE_ASCII, saveMap
                .get(field).length(), saveMap.get(field)
                .getBytes());
        try {
          exifTags.getOrCreateExifDirectory().add(outputField);
View Full Code Here

Examples of org.apache.sanselan.formats.tiff.write.TiffOutputField

        // Example of how to remove a single tag/field.
        //
        // Note that this approach is crude: Exif data is organized in
        // directories.  The same tag/field may appear in more than one
        // directory.
        TiffOutputField aperture = outputSet
            .findField(TiffConstants.EXIF_TAG_APERTURE_VALUE);
        if (null != aperture)
        {
          // set contains aperture tag/field.
          outputSet
              .removeField(TiffConstants.EXIF_TAG_APERTURE_VALUE);
        }
      }

      {
        // Example of how to add a field/tag to the output set.
        //
        // Note that you should first remove the field/tag if it already exists
        // in this directory.  See above.
        //
        // Certain fields/tags are expected in certain Exif directories;
        // Others can occur in more than one directory (and often have a different
        // meaning in different directories).
        //
        // TagInfo constants often contain a description of what directories
        // are associated with a given tag.
        //
        // see org.apache.sanselan.formats.tiff.constants.AllTagConstants
        //
        TiffOutputField aperture = TiffOutputField.create(
            TiffConstants.EXIF_TAG_APERTURE_VALUE,
            outputSet.byteOrder, new Double(0.3));
        TiffOutputDirectory exifDirectory = outputSet
            .getOrCreateExifDirectory();
        exifDirectory.add(aperture);
View Full Code Here

Examples of org.apache.sanselan.formats.tiff.write.TiffOutputField

          //            Debug.debug(
          //                "\t" + "unknown tag(0x"
          //                    + Integer.toHexString(srcField.tag)
          //                    + ") bytes", bytes);

          TiffOutputField dstField = new TiffOutputField(
              srcField.tag, tagInfo, fieldType, count, bytes);
          dstField.setSortHint(srcField.getSortHint());
          dstDir.add(dstField);
        }

        dstDir.setTiffImageData(getTiffImageData());
        dstDir.setJpegImageData(getJpegImageData());
View Full Code Here

Examples of org.apache.sanselan.formats.tiff.write.TiffOutputField

                    //                        Debug.debug(
                    //                                "\t" + "unknown tag(0x"
                    //                                        + Integer.toHexString(srcField.tag)
                    //                                        + ") bytes", bytes);

                    TiffOutputField dstField = new TiffOutputField(
                            srcField.tag, tagInfo, fieldType, count, bytes);
                    dstField.setSortHint(srcField.getSortHint());
                    dstDir.add(dstField);
                }

                dstDir.setTiffImageData(getTiffImageData());
                dstDir.setJpegImageData(getJpegImageData());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.