Error on loading HEIC

Hello Support,

loading the attached HEIC files with Imaging cause following exception:

Message:

Aspose.Imaging.CoreExceptions.ImageSaveException : Image saving failed.
  ----> Aspose.Imaging.CoreExceptions.ImageSaveException : Image export failed.
  ----> System.NotImplementedException : Tile mode is not supported

Stack Trace:

Image.Save(String filePath, ImageOptionsBase options, Rectangle boundsRectangle)
Image.Save(String filePath, ImageOptionsBase options)
Tests.ConvertHEICtoPDF(String fileName) line 290
Tests.Export(String fileName, BaseComparer comparer, ImageOptionsBase options, String ext) line 226
Tests.ExportToPdf(String fileName) line 99
RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
MethodBaseInvoker.InvokeDirectByRefWithFewArgs(Object obj, Span`1 copyOfArgs, BindingFlags invokeAttr)
--ImageSaveException
Image.Save(Stream stream, ImageOptionsBase optionsBase, Rectangle boundsRectangle)
RasterImage.Save(Stream stream, ImageOptionsBase optionsBase, Rectangle boundsRectangle)
<22 more frames...>
#=zaswLa0mWYML58q3HMoeOOJtDAmI8NnJbapvpltmKEW98.#=zw8tCOIzT9_aIB9JfmeDUmBw=(Rectangle #=zYMo1RGI=, IPartialArgb32PixelLoader #=zg1IBBt0Dvc6X)
RasterImage.#=zqbwTlLOzL8rO(Rectangle #=zYMo1RGI=, IPartialArgb32PixelLoader #=zY_pqsJoXK75T, Boolean #=zF9o9pbVjjzEjFc9QTA==)
RasterImage.#=zw8tCOIzT9_aIB9JfmeDUmBw=(Rectangle #=zYMo1RGI=, IPartialArgb32PixelLoader #=zg1IBBt0Dvc6X, Boolean #=zF9o9pbVjjzEjFc9QTA==)
JpegImage.#=zW12exWNPjROg(RasterImage #=z5lswIRY=, JpegOptions #=ziuHeX0w=, #=zXj5pXJbOf6EFOffbkmmKQo_9AzaSIhjUVhOqbd56QPVE #=zzJXbDCI9_W7O, Rectangle #=zbtvbKiDzEhjX)
JpegImage.#=zIyvhmBZYSKg8(RasterImage #=z1TJ$rk1olFPl, Stream #=z80ghu$I=, JFIFData #=z7qta8SCHPEUX, Byte[] #=zBEUItkA39pvDX38j$A==, JpegOptions #=ziuHeX0w=, Rectangle #=zx5h2fb$6MPxM)
#=zmCoNjzcN6Ry244fqtzH0FZm93v8gRRg4em1mifj06$OEoHLCwyxTuOU=.#=zCK8$FY0=(#=zl7Kqlvk= #=z_GBQ4wQ=, RasterImage #=zzIpaRp7NnnIfXGJZ8w==, Stream #=z80ghu$I=, ImageOptionsBase #=zBpZiSuk=, Rectangle #=zS1ndS62v76cf)
#=z_XVCqhK8JtTHOiNyMQ1dJJJwAUw9tu4pnsI9mSytxmUZgKSiY$ZYtQyRqp0b.#=zCK8$FY0=(#=zl7Kqlvk= #=z_GBQ4wQ=, Image #=z5lswIRY=, Stream #=z80ghu$I=, ImageOptionsBase #=zBpZiSuk=, Rectangle #=zS1ndS62v76cf, Rectangle #=zwC274iq4A$YR5yYcOA==)
#=zk3UjrXGYZd8GxHRfnI4UzNayiNSM4qn5yOfeEIl5SwSRh1Lszg==.#=zwLIvW_tAUEALP4MOFw==(#=zl7Kqlvk= #=zXYn6Gyh6cQJf, IMultipageImage #=z5lswIRY=, Stream #=z80ghu$I=, ImageOptionsBase #=zBpZiSuk=, Rectangle #=zS1ndS62v76cf, Rectangle #=zwC274iq4A$YR5yYcOA==)
#=zk3UjrXGYZd8GxHRfnI4UzNayiNSM4qn5yOfeEIl5SwSRh1Lszg==.Export(Image #=z5lswIRY=, Stream #=z80ghu$I=, ImageOptionsBase #=zBpZiSuk=, Rectangle #=zwC274iq4A$YR5yYcOA==)
Image.Save(Stream stream, ImageOptionsBase optionsBase, Rectangle boundsRectangle)

the used source code:

HEICImage.Register();
using (var image = (HEICImage)Aspose.Imaging.Image.Load(inputFileName))
{
    var exportOptions = new Aspose.Imaging.ImageOptions.JpegOptions();
    // Save image to jpg
    image.Save(outFileName, exportOptions);
    
    //Save image  to pdf
    var pdfexportOptions = new Aspose.Imaging.ImageOptions.PdfOptions();
    
    image.Save(outFileNamePdf, pdfexportOptions);
}

Can you please check and give me a feedback?
Thanks
Vasilis

HEIC_Files.zip (1.9 MB)

@VasilisGiannoutsos

Cause

The error you’re encountering, “Tile mode is not supported,” typically occurs when the HEIC image format is being processed in a way that is not fully supported by the current version of the Aspose.Imaging library. This can happen if the HEIC image contains specific features or settings that the library cannot handle.

Solution

To resolve this issue, ensure that you are using the latest version of the Aspose.Imaging library, as updates often include support for new features and formats. Additionally, check if the HEIC files you’re trying to load have any specific characteristics that could be causing the issue.

Here’s an updated approach to convert HEIC images to PDF:

Code

// Ensure you have the latest version of Aspose.Imaging and FileFormat.Heic
HEICImage.Register();
using (var image = (HEICImage)Aspose.Imaging.Image.Load(inputFileName))
{
    var pdfExportOptions = new Aspose.Imaging.ImageOptions.PdfOptions();
    
    // Save image to PDF
    image.Save(outFileNamePdf, pdfExportOptions);
}

Next Steps

  1. Update your Aspose.Imaging library to the latest version.
  2. Verify the characteristics of the HEIC files you are using.
  3. Test the provided code snippet to see if it resolves the issue.

If the problem persists, please share more details about the specific HEIC files or any additional error messages you encounter. I look forward to your feedback on whether this resolves your issue!

The problem is not solved by the suggested troubleshooting

The problem is not solved by the suggested troubleshooting
HEIC_Files.zip (1.9 MB)

@VasilisGiannoutsos, hi

These files are created using tile mode and the tile mode decoder is not implemented at the moment.
The implementation is planned for the second half of this year.