DXF to JPEG results in a cropped image in Amazon Linux 2

Hello,

We’re trying Aspose.CAD to convert DXF files to JPEG images with .Net 6. It works great on windows and Ubuntu under windows (windows subsystem for linux) on our local dev environment but when we deploy our .Net 6 application to an amazon linux 2 test instance, the image output of save operation results in a cropped image.

Here is the cropped output image: amazon-linux-2-image-output.jpeg (278.5 KB)
And here is the correct image output: ubuntu-wsl-under-windows-image-output.jpeg (318.7 KB)

So currently we are unable to fix this cropped / offset image generated by the Aspose.CAD on linux instance. Could you guys help us here on how to fix this?


System Details

  • C# net6.0 application
  • Aspose.CAD - version 22.2.0
  • Amazon Linux 2 instance

Background:
We had some problems earlier with Aspose.Cad on Linux server and resolved them

  1. First we had a font issue :

Image export failed. Cannot find table ‘loca’ in the font file. at Aspose.CAD.Image.SaveInternal(Stream stream, ImageOptionsBase optionsBase)

We solved this by installing microsoft fonts on the system.

  1. Second we had a Drawing library issue.

Image export failed. The type initializer for ‘Gdip’ threw an exception. at Aspose.CAD.Image.SaveInternal(Stream stream, ImageOptionsBase optionsBase)

We solved this by installing libgdiplus.

1 Like

@kakdeniz,
Hello, could you please also share the initial DXF file so we can test it. Could you also try more recent version of Aspose.CAD on your side?

@Oleksii.Gorokhovatskyi
Hey, thanks for replying quickly.

I have updated the version to 22.7, tried again but the issue persists.

Here are the sample dxf file to reproduce the issue along with resulting images:
files: dxf-and-images.zip (1.4 MB)

the image with the name amazon-linux has the image off set while the other image is what it should look like.

@kakdeniz,
thank you, we will try to test and investigate this on our side, I created CADNET-8752 to cover this issue.

@Oleksii.Gorokhovatskyi
Hey there,

is there any update on this? It’s been a while.

@kakdeniz,
hello, not yet, this task is pending for the investigation, scheduled for next week.

@Oleksii.Gorokhovatskyi
hey there,

any update on this issue? We are unable to fix it on our side.

@kakdeniz,
Hello, we are working on the fix for this issue.

@kakdeniz,
Hello, could you please test, is this problem still appears in 22.8 release?

1 Like

@Oleksii.Gorokhovatskyi
Hi there,

I updated the package to 22.8.0 and published the app to amazon-linux-2 instance and got this strange error below while trying with the same dxf provided above:

Image export failed. The type initializer for ‘#=zHmAp09JU$o_wkWSE4cY2caMAlm9gxyjyW_KdFFsMW0iU’ threw an exception.
[08:12:56 ERR] at Aspose.CAD.Image.#=zs1FI42$3$AqO(Stream #=zVP1TcxM=, ImageOptionsBase #=zBusRUpo=)

It used to be something like.

Image export failed. The type initializer for ‘Gdip’ threw an exception. at Aspose.CAD.Image.SaveInternal(Stream stream, ImageOptionsBase optionsBase)

I have installed “libgdiplus” on the instance btw.

@kakdeniz,
your initial issue seems to be fixed for 22.8, and the last error hopefully will be fixed in 22.9.

@Oleksii.Gorokhovatskyi
Thanks for the clarification. Is there a date for 22.9 release yet? How soon should we expect it?

@kakdeniz,
there is no strict date, 22.9 is expected till the end of September.

The issues you have found earlier (filed as CADNET-8752) have been fixed in this Aspose.CAD for .NET 22.11 update. This message was posted using Bugs notification tool by Oleksii.Gorokhovatskyi

@kakdeniz,
please, note, you need to have fonts required for the export in the \usr\share\fonts folder.