I’m using your sample code for watermarking images.
I trying to add a watermark to this jpeg file that I uploaded but there is an exception when I want to save the file.
Exception message: “Unable to find assembly 'Aspose.Imaging, Version=20.7.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56”
I added a JpegOptions to the function and after that, the file was saved and watermarked successfully. The only problem was that is the processed file metadata was removed.
image.Save(outPath, new Aspose.Imaging.ImageOptions.JpegOptions());
The image metadata contains Hebrew text. Could it cause this problem?
sample_file.zip (1.2 MB)
Aspose.Imaging 20.7.0 version, .NETStandard 2.1 on .Net Core Runtime 1.8
The whole exception message:
System.Runtime.Serialization.SerializationException: Unable to find assembly ‘Aspose.Imaging, Version=20.7.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56’.
at System.Runtime.Serialization.Formatters.Binary.BinaryAssemblyInfo.GetAssembly()
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.GetType(BinaryAssemblyInfo assemblyInfo, String name)
at System.Runtime.Serialization.Formatters.Binary.ObjectMap…ctor(String objectName, String[] memberNames, BinaryTypeEnum[] binaryTypeEnumA, Object[] typeInformationA, Int32[] memberAssemIds, ObjectReader objectReader, Int32 objectId, BinaryAssemblyInfo assemblyInfo, SizedArray assemIdToAssemblyTable)
at System.Runtime.Serialization.Formatters.Binary.BinaryParser.ReadObjectWithMapTyped(BinaryObjectWithMapTyped record)
at System.Runtime.Serialization.Formatters.Binary.BinaryParser.ReadObjectWithMapTyped(BinaryHeaderEnum binaryHeaderEnum)
at System.Runtime.Serialization.Formatters.Binary.BinaryParser.Run()
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(BinaryParser serParser, Boolean fCheck)
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, Boolean check)
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream)
at .(Object )
at .()
at .Process(Rectangle , Byte[] , Point , Point)
at .Process(Rectangle , Int32[] , Point , Point)
at .Process(Rectangle , Int32[] , Point , Point)
at .(Rectangle , IPartialArgb32PixelLoader )
at .(Rectangle , IPartialArgb32PixelLoader )
at …LoadPartialArgb32Pixels(Rectangle , IPartialArgb32PixelLoader )
at . (Rectangle )
at .( , IList1 , ) at .(Rectangle , , , Int32, Int32 , ) at .(Rectangle , , ) at .LoadPartialArgb32Pixels(Rectangle , IPartialArgb32PixelLoader ) at . (Rectangle ) at .( , IList
1 , )
at .(Rectangle , , , Int32, Int32 , )
at .(Rectangle , , )
at . (Rectangle , IPartialArgb32PixelLoader )
at Aspose.Imaging.FileFormats.Jpeg.JpegImage.(RasterImage , JpegOptions , , Rectangle)
at Aspose.Imaging.FileFormats.Jpeg.JpegImage.(RasterImage , Stream , JFIFData , JpegExifData, XmpPacketWrapper , JpegOptions , Rectangle )
at Aspose.Imaging.FileFormats.Jpeg.JpegImage.SaveData(Stream stream)
at Aspose.Imaging.DataStreamSupporter.Save(Stream stream)
at Aspose.Imaging.DataStreamSupporter.Save(String filePath)
Thanks,
Gabor