Hi,
This is a code we have used for some time now but all of a sudden stopped working. Please see the code below:
The code basically gets a PPTX file and creates thumbnails out of the file. It all of a sudden stopped working yesterday. We’ve currently installed the latest version of ASPOSE.SLIDE Java 19.2, we’ve even rolled back to earlier versions, but same issue. See error details below the code.
include_once "../config/core.php";
require __DIR__ . '/../../vendor/autoload.php';
require_once("../../Java.inc");
$asposelicencepath = "licenspath/Aspose.Slides.lic";
//$license = new java("com.aspose.slides.License");
//$licensestream = $license->setLicense("/data/www/slidesorter/aspose/Aspose.Slides.lic");
//Create a stream object containing the license file
//$fistream=new Java("java.io.FileInputStream","C:\\Aspose.Slides.Java.lic");
$license = new java("com.aspose.slides.License");
$fistream=new Java("java.io.FileInputStream",$asposelicencepath);
$licensestream = $license->setLicense($fistream);
# Instantiate Presentation class that represents the presentation file
$pres = new java('com.aspose.slides.Presentation', '/Users/apache-tomcat-8.5.37/htdocsfiles/LatestDigitalPIs.pptx');
# Access the first slide
$slide = $pres->getSlides()->get_Item(0);
# Create a full scale image
$image = $slide->getThumbnail();
# Save the image to disk in JPEG format
$ImageIO = new java('javax.imageio.ImageIO');
$ImageIO = new java('javax.imageio.ImageIO');
$ImageIO->write($image, 'jpg', "/Users/apache-tomcat-8.5.37/htdocsfiles/ContentBG_tnail.jpg");
Fatal error: Uncaught [[o:Exception]:“java.lang.Exception: Invoke failed: [[c:ImageIO]]->write((i:RenderedImage)[o:BufferedImage], (o:String)[o:String], (o:OutputStream)[o:String]). Cause: java.lang.IllegalArgumentException: argument type mismatch VM: 1.8.0_111@http://java.oracle.com/” at: #-10 sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) #-9 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) #-8 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) #-7 java.lang.reflect.Method.invoke(Method.java:498) #-6 php.java.bridge.JavaBridge.Invoke(JavaBridge.java:1068) #-5 php.java.bridge.parser.Request.handleRequest(Request.java:426) #-4 php.java.bridge.parser.Request.handleRequests(Request.java:509) #-3 php.java.bridge.http.ContextRunner.run(ContextRunner.java:143) #-2 php.java.bridge.util.ThreadPool$Delegate.run(ThreadPool.java:60) #-1 php.java.bridge.util.AppThreadPool$Delegate.run(AppThreadPool.java:58) #0 /Users/apache-tomcat-8.5.37/webapps/sl in /Users/j/apache-tomcat-8.5.37/webapps/slidesorter/Java.inc on line 224