Package com.sun.media.jai.codec

Examples of com.sun.media.jai.codec.FileSeekableStream


    public JAITiffHelper(String file){

        try{
            //Get file info
            File imgFile = new File(file);
            FileSeekableStream s = new FileSeekableStream(imgFile);
            dec = ImageCodec.createImageDecoder("tiff", s, null);
            pageCount=dec.getNumPages();

        }catch(Exception e){
            e.printStackTrace();
View Full Code Here


            // Create a SeekableStream from the file name (first parameter).
            String fileName = (String)args.getObjectParameter(0);

      SeekableStream src = null;
      try {
                src = new FileSeekableStream(fileName);
            } catch (FileNotFoundException fnfe) {
    // Try to get the file as an InputStream resource. This would
    // happen when the application and image file are packaged in
    // a JAR file
    InputStream is = this.getClass().getClassLoader().getResourceAsStream(fileName);
View Full Code Here

/*     */   {
/*  91 */     ImagingListener listener = ImageUtil.getImagingListener(hints);
/*     */     try
/*     */     {
/*  95 */       String fileName = (String)args.getObjectParameter(0);
/*  96 */       SeekableStream src = new FileSeekableStream(fileName);
/*     */
/*  98 */       ImageDecodeParam param = null;
/*  99 */       if (args.getNumParameters() > 1) {
/* 100 */         param = (ImageDecodeParam)args.getObjectParameter(1);
/*     */       }
View Full Code Here

/*     */   public static void main(String[] args)
/*     */   {
/*     */     try
/*     */     {
/* 624 */       RandomAccessFile f = new RandomAccessFile(args[0], "r");
/* 625 */       SeekableStream sis = new FileSeekableStream(f);
/* 626 */       StructuredStorage ss = new StructuredStorage(sis);
/*     */
/* 628 */       ss.changeDirectoryToRoot();
/*     */
/* 630 */       byte[] s = ss.getStreamAsBytes("\005SummaryInformation");
View Full Code Here

     */
    public void processFile(File file, File newFile) {
        try {
            log("Processing File: " + file.getAbsolutePath());

            FileSeekableStream input = null;
            PlanarImage image = null;
            try {
                input = new FileSeekableStream(file);
                image = JAI.create("stream", input);
                for (int i = 0; i < instructions.size(); i++) {
                    Object instr = instructions.elementAt(i);
                    if (instr instanceof TransformOperation) {
                        image = ((TransformOperation) instr)
View Full Code Here

     */
    public void processFile(File file, File newFile) {
        try {
            log("Processing File: " + file.getAbsolutePath());

            FileSeekableStream input = null;
            PlanarImage image = null;
            try {
                input = new FileSeekableStream(file);
                image = JAI.create("stream", input);
                final int size = instructions.size();
                for (int i = 0; i < size; i++) {
                    Object instr = instructions.elementAt(i);
                    if (instr instanceof TransformOperation) {
View Full Code Here

     * @param file The file to be processed
     */
    public void processFile(File file) {
        try {
            log("Processing File: " + file.getAbsolutePath());
            FileSeekableStream input = new FileSeekableStream(file);
            PlanarImage image = JAI.create("stream", input);
            for (int i = 0; i < instructions.size(); i++) {
                Object instr = instructions.elementAt(i);
                if (instr instanceof TransformOperation) {
                    image = ((TransformOperation) instr).executeTransformOperation(image);
                } else {
                    log("Not a TransformOperation: " + instr);
                }
            }
            input.close();

            if (str_encoding.toLowerCase().equals("jpg")) {
                str_encoding = "JPEG";
            } else if (str_encoding.toLowerCase().equals("tif")) {
                str_encoding = "TIFF";
View Full Code Here

  public XMPExtractor xmpex;
 
  public TifExtractor(File f) {
    this.file = f;
    try {
      fss = new FileSeekableStream(f);
      if (fss != null) {
        tiffdir = new TIFFDirectory(fss, 0);
      }
    } catch (IOException e) {
      e.printStackTrace();
View Full Code Here

TOP

Related Classes of com.sun.media.jai.codec.FileSeekableStream

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.