use of org.fagu.fmv.soft.Soft in project fmv by f-agu.
the class PipeInOutTest method testPipeIn.
/**
* @throws Exception
*/
@Test
public void testPipeIn() throws Exception {
File srcFile = ImageResourceUtils.extractFile("bad-ass-tattoo-fail.jpg");
File destFile = new File(srcFile.getPath() + ".piped." + FilenameUtils.getExtension(srcFile.getName()));
try {
Soft convertSoft = Convert.search();
IMOperation op = new IMOperation();
// <-------- means standard input
op.image("-").autoOrient().quality(60D).image(destFile);
try (InputStream inputStream = new FileInputStream(srcFile)) {
convertSoft.withParameters(op.toList()).input(// <--------- in
inputStream).execute();
}
assertEquals(EXPECTED_SHA1, sha1Of(destFile));
} finally {
srcFile.delete();
destFile.delete();
}
}
use of org.fagu.fmv.soft.Soft in project fmv by f-agu.
the class PipeInOutTest method testPipe_no.
/**
* @throws Exception
*/
@Test
public void testPipe_no() throws Exception {
File srcFile = ImageResourceUtils.extractFile("bad-ass-tattoo-fail.jpg");
File destFile = new File(srcFile.getPath() + ".piped." + FilenameUtils.getExtension(srcFile.getName()));
try {
Soft convertSoft = Convert.search();
IMOperation op = new IMOperation();
op.image(srcFile).autoOrient().quality(60D).image(destFile);
convertSoft.withParameters(op.toList()).execute();
assertEquals(EXPECTED_SHA1, sha1Of(destFile));
} finally {
srcFile.delete();
destFile.delete();
}
}
Aggregations