Some of postscript files (*.ps) failed with exceptions: IndexOutOfRangeException, NotSupportedException and ImageSaveException

Hello,
Some postscript files failed with following exceptions:

  • IndexOutOfRangeException:
    I got this exception when trying to save file and file is empty or font file.
    When handling it in Catch block and try using Aspose.Imaging, it succeeded and gave me an empty image.
    Code and exception:
    Code_And_IndexOutOfRangeException.png (61.8 KB)
    Some ex. files that failed:
    IndexOutOfRange_Files.zip (397.2 KB)

  • NotSupportedException:
    I got this exception when loading some files using the same code in the image above.
    And aslo it succeeded when using Aspose.Imaging.
    Exception:
    NotSupported.png (4.0 KB)
    Ex. file that failed:
    NotSupportedException .zip (1.6 KB)

  • NotSupportedException and ImageSaveException:
    I got the same exception “NotSupportedException” in the image above using the same code in the code image above, but this time some files failed even using Aspose.Imaging and gave exception “ImageSaveException” with different weird messages.
    Exceptions from Aspose.Imaging:
    ImageSaveException1.png (3.5 KB)
    ImageSaveException2.png (3.9 KB)
    Ex. files that failed:
    NotSupported_ImageSave_Exception_Files.zip (55.8 KB)
    Big file here: Filebin | e4sz2sir0au7a668

@muhammadzaghloul

We are testing the scenario in our environment and will get back to you shortly.

@muhammadzaghloul

What we understood from your post is that you are facing different exceptions for different type of files using the same code snippet. While catching the exceptions, you are trying Aspose.Imaging as an alternative and they are getting processed without any exceptions.

However, for the last case, Aspose.Imaging is also throwing exceptions. Please let us know if we got it correct.

Hello,

Yes you are right.
Handling postscript files using the same code snippet => in case of catching exceptions => trying Aspose.Imaging => some files are getting processed without any exceptions, some files are throwing exceptions -like attached before which contains different reasons-.

But I don’t use different type of files, I am using only postscript files “*.ps” like what I attached before.

@muhammadzaghloul

We are checking the scenario in our environment and will get back to you shortly.

Thank you, I am waiting for any updates.