@Milijanovic00
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): IMAGINGNET-7460
You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.
Can you please give me some expected date on which it’ll be finished?
And one more thing, is this fix going to be provided in the new version of Aspose.Imaging or in Aspose.Imaging.HEIC.Adapter?
The reason I ask is that I noticed there is a newer version of Aspose.Imaging which is 24.11.0 and I switched to it but when I tried to convert the heic image I got an error saying something like “This version of Aspose.Imaging.HEIC.Adapter is too old for this new version of Aspose.Imaging”.
Aspose.Imaging.HEIC.Adapter was updated to 24.11.0 with the fix.
Also we have applied the new dependency strategy for adapters and now you can use newer Aspose.Imaging versions with an older apapter (the version difference cannot be more then 3 months, but there is no more strict version dependecy).
I encountered the same issue described earlier when trying to convert a HEIC image to JPEG using Aspose.Imaging (version 24.11.0) and Aspose.Imaging.HEIC.Adapter (version 24.11.0). While testing, I observed that the problem persists when uploading multiple HEIC files for conversion and processing in sequence, an IndexOutOfRangeException occurs specifically during the image.Save operation for the second file.
This behavior appears to indicate that the issue is not isolated to specific image files but may also occur in scenarios involving multiple file processing. Could you please investigate this further?
@VinayakaP619 Hello!
Do I understand you correctly that you call the above code in a loop, and at some point you get an error?
I will try to reproduce this code.
I would also like to note that this part of the code is redundant, it is used only for rasterization of vector images:
Hello @stanislav.popov ,
If multiple HEIC files are processed from an Azure Queue Trigger with parallel processing (e.g., batch size 3), an NullReferenceException: Object reference not set to an instance of an object. occurs during the image.Save operation. This issue does not occur when the batch size is set to 1.
The zip file contains a list of HEIC images that I attempted to convert: HEIC_FILES.zip (8.4 MB)
Hello @VinayakaP619 ,
We will research the parallel processing and look for the reason of that behavior.
Can you please provide the code that throws this exception for you? Any additional data may help us with searching the root of the problem.
Hello @Nikita_Romanov ,
Here’s a code snippet that reproduces the issue:
private static ConversionResultData ScaleHeicImageViaAspose(Stream sourceFileStream, int size, bool isHighQuality)
{
var resultStream = new MemoryStream();
try
{
var heicLoadOptions = HEICLoadOptions.Create();
using var image = (HEICImage)Aspose.Imaging.Image.Load(sourceFileStream, heicLoadOptions);
var aspectRatio = (double)image.Width / image.Height;
var newHeight = (int)(size / aspectRatio);
var options = new Aspose.Imaging.ImageOptions.JpegOptions
{
CompressionType = Aspose.Imaging.FileFormats.Jpeg.JpegCompressionMode.Progressive,
VectorRasterizationOptions = new Aspose.Imaging.ImageOptions.VectorRasterizationOptions()
{
PageWidth = size,
PageHeight = newHeight,
SmoothingMode = isHighQuality ? Aspose.Imaging.SmoothingMode.HighQuality : Aspose.Imaging.SmoothingMode.Default,
}
};
image.Save(resultStream, options); // for parallel processing this is where the code breaks with NullReferenceException: Object reference not set to an instance of an object
resultStream.Seek(0, SeekOrigin.Begin);
return new ConversionResultData() { Stream = resultStream, FileWidth = size, FileHeight = newHeight };
}
catch (Exception ex)
{
resultStream.Dispose();
return new ConversionResultData() { Exception = ex };
}
}
there are several other issues with HEIC that need our attention, so it is likely to enter 25.02 release, if there is no release difficulties. Please pay attention that HEIC release is a separate from Aspose.Imaging and may occurr in the second half of the month.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.