I found that Aspose.Note .NET version after 22.3.0 i.e. starting from 22.5.0 has issues regarding extracting images from OneNote files.
I have multiple samples where Aspose.Note when extracting image fails to get the correct binary data of the image. Image.Bytes yields the incorrect binary data for the image file, it outputs out a zip file.
Please check the snippet code below
Document oneNote = new Document(“OneNoteFile”);
var allImageNodes = doc.GetChildNodes();
using(var outStream = new FileStream(tempFile, FileMode.Create, FileAccess.ReadWrite, FileShare.Read))
outStream.Write(image.Bytes, 0, image.Bytes.Length);
contain_txt_printout.zip (545.8 KB)
If you check the tempFile then its a zip file not an image file.
Please find the file attached here:
@dunghnguyen,
I reproduced the issue using the latest version/fix: Aspose.Note for .NET v23.2. I found Aspose.Note does not get image’s binary data correctly from the OneNote document.
e.g.
Sample code:
Aspose.Note.Document onedoc = new Aspose.Note.Document("g:\\test2\\contain_txt_printout.one");
IList<Aspose.Note.Image> nodes = onedoc.GetChildNodes<Aspose.Note.Image>();
foreach (Aspose.Note.Image image in nodes)
{
using (var outStream = new FileStream("g:\\test2\\out1" + image.FileName + ".png", FileMode.Create, FileAccess.ReadWrite, FileShare.Read))
outStream.Write(image.Bytes, 0, image.Bytes.Length);
}
-----
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): NOTENET-5755
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.
Thank you @amjad.sahi for the prompt reply, I look forward to hearing back from you and the team.
@dunghnguyen,
Sure, we will keep you posted with updates once available.
Hello @amjad.sahi, can you share the status of this ticket? I view this issue as a severe bug and I’m sure other agree too. Please lmk asap, thank you!
@dunghnguyen,
I am afraid, there is no update on your issue. We will check if we could provide an update or a possible ETA on it. We will get back to you soon.
@dunghnguyen,
We are in the process to figure out the issue. Hopefully, the fix will be included in the upcoming release. Once the next version is published, you will be notified in this thread.
1 Like
Much appreciated, thanks for letting me know!
The issues you have found earlier (filed as NOTENET-5755) have been fixed in this update. This message was posted using Bugs notification tool by senua.remizova