ImageLoadException: Image loading failed on accesing DWG file using Aspose.CAD (Java)

We are getting quite a lot of failures opening certain AutoCAD files and it is difficult to find the cause. Sometimes a purge helps, but sometimes it still fails to open the file:

class com.aspose.cad.cadexceptions.ImageLoadException: Image loading failed. —> class com.aspose.cad.cadexceptions.imageformats.CadException: File is incompatible with exporter, please try to convert it to Dxf: R12/R2007/R2010 or Dwg: R13/R14/R2000/R2004/R2007/R2010/R2013/R2014/R2015/R2018
com.aspose.cad.internal.eK.a.b(Unknown Source)
com.aspose.cad.fileformats.cad.CadImage.a(Unknown Source)
com.aspose.cad.fileformats.cad.CadImage.setLayers(Unknown Source)
com.aspose.cad.internal.fv.aU.load(Unknown Source)
com.aspose.cad.Image.a(Unknown Source)
com.aspose.cad.Image.load(Unknown Source)

The version is of the AutoCAD file is R2010 (AC1024). I’m not trying to convert just the Image.load method.
Can i send some example DWG files?

@bart.vanderschoot,

I have observed the issue shared by you and request you to please first try using latest Aspose.CAD for Java 18.12 on your end. In case the issue still persist then please provide the sample files along with used sample code reproducing the issue. We will investigate the issue further on our end to help you out.

I am getting a lot of errors loading files. For the moment I am using Java CAD version 19.5.
This is getting very frustrating. Is there a solution for this problem?

class com.aspose.cad.cadexceptions.ImageLoadException: Image loading failed. —> class com.aspose.cad.internal.Exceptions.ArgumentNullException: Value cannot be null.
Parameter name: path1
com.aspose.cad.internal.R.t.b(Unknown Source)
com.aspose.cad.internal.eQ.p.a(Unknown Source)A0.65-22-11.00.DWG.zip (194.8 KB)

@bart.vanderschoot,

I have worked with sample file shared by you and have been able to observe the issue. An issue with ID CADJAVA-497 has been created in our issue tracking system to investigate and resolve the issue. This thread has been linked with the issue so that you may be notified once the issue will be fixed.

I am still waiting for a solution. Is there a way to get faster support to solve this issue?

@bart.vanderschoot,

I have verified from our issue tracking system and regret to share that the issue is still unresolved. We will be able to share the good news with you as soon as the issue will be fixed and request for your patience. If you want to expedite the issue resolution, you may consider opting our Paid Support service as well.

I have been patient for a while and was happy to see a new version arriving 19.7
Unfortunately there is no good news. Still having the same error when opening files

Caused by: class com.aspose.cad.internal.Exceptions.ArgumentNullException: Value cannot be null.
Parameter name: path1
com.aspose.cad.internal.R.t.b(Unknown Source)
com.aspose.cad.internal.eQ.p.a(Unknown Source)
com.aspose.cad.internal.eQ.p.a(Unknown Source)
com.aspose.cad.internal.eQ.p.a(Unknown Source)
com.aspose.cad.internal.eP.f.b(Unknown Source)
com.aspose.cad.internal.eP.k.(Unknown Source)
com.aspose.cad.fileformats.cad.CadImage.updateSize(Unknown Source)

It is important for us to get a solution.

@bart.vanderschoot,

I like to inform that this issue will be resolved in Aspose.CAD 19.9. I request for your patience.

I tested with version 19.9, but I don’t see much improvement. Since we don’t have the source files, the only solution will be to decompile the jar file and try to fix it ourself.

@bart.vanderschoot,

The associated issue with this thread was related to exception on loading the CAD file. Do you still find issue with your file on loading. Please share the details with us so that we may proceed further to help you.

I don’t think any of my problems is solved in this release. I know it is not your fault, but this is not going anywhere. Due to heavy obfuscating, it is very difficult to decompile and correct it our self.
Can you give me information or a contact person so we can get the original source code?
We will be glad to share any correction made so in the end the product will only get better.

@bart.vanderschoot,

This issue has been resolved. Can you please try to use Aspose.CAD 19.9 on your end and share feedback with us.

The issues you have found earlier (filed as CADJAVA-497) have been fixed in this update.