Cause . . . . . : RPG procedure ACELLADDPI in program AAITMRMP1/ACELLSRV received Java exception "java.lang.IllegalArgumentException: Unsupported image foramt." when calling method "add" with signature "(IIIILjava.lang.String;)I" in class "com.aspose.cells.Pictures".
I tried with .jpg and .bmp, but both formats give the same problem !
Is there another problem ? I'm using aspose.cells for java.
Well, I don't find the problem, you are mentioning. I tested with both .jpg and .bmp files and it's fine.
Which version of Aspose.Cells for java you are using? Please try the latest hotfix version downloading @: <A href="</A></P>
<P>If you still find the problem, kindly send you image with sample code here.</P>
<P>Thank you.</P>
What's the enviroment for this code to compile and run? I am puzzled by the syntax of it, it doesn't look like valid java code. And some methods invoked in your code haven't been supplied in API, such as the "getPictures" method for Worksheet with an argument.
Another important thing, the software must be used as a complete jar lib, unzip the classes and use them will cause problems.
This code is written in RPG, where we call java methods.
I'm not a java expert, but I'll try to translate the code for you : O_Pictures = Sheet.getPictures lIdx = O_Pictures.Add(r1,c1,r2,c2,picture) O_Picture = O_Pictures.get(lIdx)
You don't have to worry about my syntax ! Am I taking the wright steps ?
Would you please try following code in java and give me the output?
ImageInputStream iis = javax.imageio.ImageIO.createImageInputStream(new FileInputStream(picture)); //picture is the picture file you used in you program Iterator it = javax.imageio.ImageIO.getImageReaders(iis); if(it.hasNext()) { String formatName = ((ImageReader)it.next()).getFormatName(); formatName = formatName.toUpperCase(); System.out.println(formatName); }
Java exception "java.lang.IllegalArgumentException: Unsupported image foramt." when calling method "add" with signature "(IIIILjava.io.InputStream;)I" in class "com.aspose.cells.Pictures".
Could you post your image files(jpg,bmp,gif)? We check this issue with your file.
In your previous reply , you said ".BMP gives no result .jpg gives JPEG". So I think the Exception should not be same when add jpg file and bmp file. Could you give us more detail info.?
Licensed material - Property of IBM. IBM(R) 32-bit SDK for Windows(R), Java(TM) 2 Technology Edition, Version 1.4.2 IBM(R) 32-bit Runtime Environment for Windows(R), Java(TM) 2 Technology Edition, Version 1.4.2
(c) Copyright Sun Microsystems Inc, 1992, 2003. All rights reserved. (c) Copyright IBM Corporation, 1998, 2004. All rights reserved.
The Apache Software License, Version 1.1 Copyright (c) 1999-2002 The Apache Software Foundation. All rights reserved.
We have not JDK1.4 of Ibm. So please help us test this. We add some debug info into this version. Please test this JPG file with fix and return the debug info.