User 2082812c83
29-01-2007 19:00:16
Hi,
After an upgrade to JChem 3.2.3 from 3.1.1 I am seeing the following class cast exception when attempting to convert a molecule object into a PNG:
java.lang.ClassCastException
at chemaxon.marvin.modules.ImageExport.makeImage(ImageExport.java:375)
at chemaxon.marvin.modules.ImageExport.convert(ImageExport.java:391)
at chemaxon.marvin.modules.PngExport.convert(PngExport.java:65)
at chemaxon.struc.Molecule.exportToObject(Molecule.java:1302)
at chemaxon.struc.Molecule.exportToObject(Molecule.java:1267)
at chemaxon.struc.Molecule.toObject(Molecule.java:1231)
The call I am making that causing this exception and which ran correctly under 3.1.1 is:
byte[] molba = (byte[])mol.toObject
("png:w" + (4*width) + ",h" + (4*height) + ",b32,#9fffffff");
Where the string argument passed to the toObject method comes out as
"png:w664,h400,b32,#9fffffff"
As I said above this code works with JChem Base 3.1.1. Could you please provide either a fix to this issue or a workaround that can be used in place of the existing code to generate a PNG from a Molecule object.
Thanks,
James
After an upgrade to JChem 3.2.3 from 3.1.1 I am seeing the following class cast exception when attempting to convert a molecule object into a PNG:
java.lang.ClassCastException
at chemaxon.marvin.modules.ImageExport.makeImage(ImageExport.java:375)
at chemaxon.marvin.modules.ImageExport.convert(ImageExport.java:391)
at chemaxon.marvin.modules.PngExport.convert(PngExport.java:65)
at chemaxon.struc.Molecule.exportToObject(Molecule.java:1302)
at chemaxon.struc.Molecule.exportToObject(Molecule.java:1267)
at chemaxon.struc.Molecule.toObject(Molecule.java:1231)
The call I am making that causing this exception and which ran correctly under 3.1.1 is:
byte[] molba = (byte[])mol.toObject
("png:w" + (4*width) + ",h" + (4*height) + ",b32,#9fffffff");
Where the string argument passed to the toObject method comes out as
"png:w664,h400,b32,#9fffffff"
As I said above this code works with JChem Base 3.1.1. Could you please provide either a fix to this issue or a workaround that can be used in place of the existing code to generate a PNG from a Molecule object.
Thanks,
James