We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Convert EMF to PNG will generate too many font files under TempFontsGraphics

When I convert EMF files to PNG file, there will be a TempFontsGraphics folder generated under user\AppData\Local\Temp\ and contains around 2GB .ttc font files.
It blocks the conversion which will last long time, and also generated too many temp font files which will occupy the disk and results in the disk full.

Since the EMF file is confidential, so I could not upload the file, but I’m trying to find a similar one. Will upload if have.
All I could tell now is the EMF contains a lot of Japanese words and characters.

Could someone help check the problem at first.

I use win10 platform and Unix platform as well.

image.png (39.4 KB)

@tldyzem

We may not be able to say anything thing concrete here as there is no example and source file. If you have used custom fonts in EMF than they should be in folder specified in code or at system. In order to reduce this you must use system fonts.

Moreover, in order to further investigate this, we will still need source file and used sample code.

Thanks for reply, it’s hard to find a similar EMF, we are trying to ask our customer whether we could send the original issued emf file here for debug. Please hold on.
Thanks

@tldyzem

We will be looking forward to further information shared from your side in this regard.

Finnally, I got that I could upload the issued emf.
please help check the problems for this emf, refer to below code:

  1. it costs almost 5 minutes to convert the image below, it’s too long
  2. there will be a TempFontsGraphics folder generated under user\AppData\Local\Temp, which contains too many font files, and result in the disk full and server down.

Please try both with font or without font installed on system. Problem exits both on win10 and ubuntu.
import com.aspose.imaging.Image;
import com.aspose.imaging.fileformats.emf.EmfImage;
import com.aspose.imaging.imageoptions.PngOptions;
PngOptions pngOpts = new PngOptions();
EmfImage image = (EmfImage)Image.load(emfPath);
image.save(pngPath, pngOpts);

image.zip (26.6 KB)

@tldyzem

Thank you for sharing the information with us. A ticket with ID IMAGINGJAVA-7772 has been created in our issue tracking system to further 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.

@tldyzem

In order to investigate the issue further on our end, can you please provide full set of font files used?

We just use the window10 default font gallary, no specified ones.

@tldyzem

We have tried to work with attached file, and can not reproduce as conversion took less than 30 seconds. Related to temp folder, we have not any temp files. It seems that you have a really low-resources machine and begin to work swapping to process such a big file (more than 6000 pxx6000px). Also please note, different viewers show different size - ie Infra View shows 16000x12000 and AcdSee, other XnView - 6000. But correct one think is as Paint shows - 16000. Related to this task we will investigate it, but we do not think that we will be able to decrease time of processing for such big file in low-resource environment (swap is natural behaviour for such case and customer must know it).

Can you please share what resources you have on server machine, this may help to concretize issue.

Currently, our test site is like:
docker memory: 16G
jvm(only for convertion): 1G-2G

and since this sample emf here is only 1 of our requirement, we may need to convert dozens of such emf pictures, and no max limit currently. we are trying to use multi-thread to do the convertion, but the memory is not enough if too many threads.

So do you have suggestions on how could we config our resources for such requirement to convert many emf pictures in short time. Parallel? And how do we config our resources which is safe and high efficient(some times the java will heap during the conversion)?

How to set the DPI for the target png and shrink the size of the the png file during conversion?

@tldyzem

Thank you for sharing the feedback. I have added the information in our issue tracking system and we will get back to you with feedback as soon as it will be shared.