I am getting the following error when running the code given on this page. I am using Python 3.8.2 and the latest available version of Aspose.Imaging for Python.
Error:
Unhandled exception. System.IO.FileLoadException: Could not load file or assembly 'System.Text.Encoding.CodePages, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The located assembly's manifest definition does not match the assembly reference. (0x80131040)
File name: 'System.Text.Encoding.CodePages, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
at Aspose.WrpGen.Interop.ExchangeHost.InitServices()
Code:
import aspose.pycore as aspycore
from aspose.imaging import Image, Color
from aspose.imaging.fileformats.png import PngImage
from aspose.imaging.imageoptions import PngOptions
with aspycore.as_of(Image.load("input-image.png"), PngImage) as image:
colors = image.load_pixels(image.bounds)
length = colors.length
for i in range(length):
if i % 2 == 0:
colors[i] = Color.red
image.save_pixels(image.bounds, colors)
image.save(os.path.join("result.png"), PngOptions())
Hello, @uax99
Thank you for your patience and help.
After investigating your issue, we found out the following.
Since the Nugget repository marked the library System.Text.Encoding.CodePages.dll version 5.0 as outdated, into the Aspose.Imaging for Python via .NET 23.6 was injected a new dependency on the System.Text.Encoding.CodePages.dll version 7.0.2.
This issue has been added to our bug tracker with the number IMAGINGNET-6478 and will be fixed in the next version of the library.
@uax99
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-6478
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.
Hello, @uax99
Sad to hear this. Unfortunately, we can not reproduce this issue on our test platform.
Could you install .NET Runtime 7.0.2 from Download .NET 7.0 (Linux, macOS, and Windows)
and test it again.
We are going to continue searching for the cause of such an error.