Package org.im4java.core

Examples of org.im4java.core.ConvertCmd.run()


    Pipe pipe = new Pipe(null, byteArrayOutputStream);

    ConvertCmd convert = new ConvertCmd();
    convert.setOutputConsumer(pipe);
    convert.run(op);

    OutputStream out = new FileOutputStream(jp2Path);
    out.write(byteArrayOutputStream.toByteArray());

    byteArrayOutputStream.close();
View Full Code Here


    op.resize(maxHeight, maxWidth);
    op.addImage(tmpJp2.getAbsolutePath());

    ConvertCmd convert = new ConvertCmd();
    try {
      convert.run(op);
    } catch (IOException e) {
      e.printStackTrace();
    } catch (InterruptedException e) {
      e.printStackTrace();
    } catch (IM4JavaException e) {
View Full Code Here

    op.addImage(tmpJp2.getAbsolutePath());
    op.addImage(tmpTn.getAbsolutePath());

    ConvertCmd convert = new ConvertCmd();
    try {
      convert.run(op);
    } catch (IOException e) {
      e.printStackTrace();
    } catch (InterruptedException e) {
      e.printStackTrace();
    } catch (IM4JavaException e) {
View Full Code Here

                op.resize(size,size);
            }

            op.addImage(outputFile.getPath());

            cmd.run(op);
        } catch (Exception e) {
            e.printStackTrace();
            return false;
        }
        return true;
View Full Code Here

            IMOperation op = new IMOperation();
            op.addImage(getFile(i).getPath());
            op.crop(width, height, left, top);
            op.addImage(outputFile.getPath());

            cmd.run(op);
        } catch (Exception e) {
            e.printStackTrace();
            return false;
        }
        return true;
View Full Code Here

            IMOperation op = new IMOperation();
            op.addImage(getFile(i).getPath());
            op.resize(width, height);
            op.addImage(outputFile.getPath());

            cmd.run(op);
        } catch (Exception e) {
            e.printStackTrace();
            return false;
        }
        return true;
View Full Code Here

            IMOperation op = new IMOperation();
            op.addImage(getFile(i).getPath());
            op.rotate(clockwise ? 90. : -90.);
            op.addImage(outputFile.getPath());

            cmd.run(op);
        } catch (Exception e) {
            e.printStackTrace();
            return false;
        }
        return true;
View Full Code Here

    op.thumbnail(width, height);
    op.addImage(f2.getAbsolutePath());
        if (MediaFilterManager.isVerbose) {
        System.out.println("IM Thumbnail Param: "+op);
        }
    cmd.run(op);
    return f2;
    }
   
    public static File getImageFile(File f, int page) throws IOException, InterruptedException, IM4JavaException {
      File f2 = new File(f.getParentFile(), f.getName() + ".jpg");
View Full Code Here

    op.addImage(f.getAbsolutePath()+s);
    op.addImage(f2.getAbsolutePath());
        if (MediaFilterManager.isVerbose) {
        System.out.println("IM Image Param: "+op);
        }
    cmd.run(op);
    return f2;
    }
   
    public boolean preProcessBitstream(Context c, Item item, Bitstream source)
            throws Exception
View Full Code Here

  private boolean imageMagickAvailable() {
    try {
      ConvertCmd cmd = new ConvertCmd();
      IMOperation versionOp = new IMOperation();
      versionOp.version();
      cmd.run(versionOp);
      logger.debug("ImageMagick detected and found to be working");
      return true;
    } catch (Throwable e) {
      logger.info("ImageMagick not available: {}", e.getMessage());
      return false;
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.