Block on adjustment of Image Settings within Excel header

Why does Aspose reset the settings on an image nestled inside of an Excel header? Turning aspose off resolves the settings issue entirely.

@tawlos
We have created a sample file and tested it using the following code. We were able to reproduce the issue and found that the image settings properties had changed. Please refer to the attachment (212.9 KB).

Workbook wb = new Workbook("sample.xlsx");
wb.Save("out.xlsx");

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): CELLSNET-53788

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.

Please confirm if the issue I described is the one you are currently experiencing. If there are any differences, please provide your sample files and screenshots, and highlight them in the screenshots. This will be very helpful for us to locate the issue.

Hello @John.He

Thank you for that quick response! It is similar to this issue but the settings that are affected are the brightness levels for the image. See attached screenshots:
image.png (7.0 KB)
image.png (9.4 KB)
image.png (9.1 KB)
image.png (42.6 KB)

@tawlos,

Thanks for the screenshots.

To evaluate your issue precisely, we need your sample Excel file(s). Could you please zip and attach the input Excel file containing the headers/footer. Also, share your sample code that you are using. We will evaluate your issue on our end and address it accordingly.

@tawlos
Which version are you using?
Please try the latest version 23.7 . We have fixed a similiar issue .

But there is another issue that if Brightness <50%, it will loose after saving by Aspose.Cells .
We will fix it soon.

Please refer to the attached input Excel zip files with the headers:
Aspose Header Testing.zip (232.3 KB)

Sample code we are using:

using System;
using Aspose.Cells;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace AsposeCellsDocumentImageProcessor
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        private void Form1_Load(object sender, EventArgs e)
        {
            Workbook wb = new Workbook("doctoupdate.xlsx");
            string imgPath = @"B:\src\AsposeCellsDocumentImageProcessor\cat.png";
            byte[] imgBytes = File.ReadAllBytes(imgPath);
            MemoryStream ms = new MemoryStream();
            ms.Write(imgBytes, 0, imgBytes.Length);
            PageSetup pageSetup = wb.Worksheets[0].PageSetup;
            // Setting the logo/picture in the central section of the page header
            FileStream inFile;
            // Declaring a byte array
            byte[] binaryData;
            // Creating the instance of the FileStream object to open the logo/picture in the stream
            inFile = new System.IO.FileStream(imgPath, System.IO.FileMode.Open, System.IO.FileAccess.Read);
            // Instantiating the byte array of FileStream object's size
            binaryData = new Byte[inFile.Length];
            // Reads a block of bytes from the stream and writes data in a given buffer of byte array.
            long bytesRead = inFile.Read(binaryData, 0, (int)inFile.Length);
            //Workbook workbook = new Workbook();
            // Worksheet worksheet = workbook.Worksheets[0];
            // worksheet.Pictures.Add(1, 1, ms);
            //UpdateImagesInDocument(wb, binaryData);
            wb.Save("document.xlsx");
        }
        //update the images
        public void UpdateImagesInDocument(Workbook wb, Byte[] bd)
        {
            //wb.Worksheets[0].Pictures.Add(1, 2, 3, 4, ms);
            // Creating a PageSetup object to get the page settings of the first worksheet of the workbook
            //PageSetup pageSetup = wb.Worksheets[0].PageSetup;
            //// Setting the logo/picture in the central section of the page header
            //pageSetup.SetHeaderPicture(1, bd);
            //// Setting the script for the logo/picture
            //pageSetup.SetHeader(1, "&G");
            //// Setting the Sheet's name in the right section of the page header with the script
            //pageSetup.SetHeader(2, "&A");
        }
    }
}

@tawlos,
By using the latest version Aspose.Cells 23.7 for testing, we can reproduce the issue of brightness changes in the file “Aspose enabled. xlsx” and found that after resaving, the brightness changed from 0% to 50%. But in the other file “Aspose disabled. xlsx”, we did not reproduce any issues. Please refer to the attachment (234.2 KB) for the saved results.

Please confirm if the issue I have reproduced is the one you are currently experiencing. If it’s the issue I described, we have already fixed it. It will be released in the next release version Aspose.Cells 23.8.

The issues you have found earlier (filed as CELLSNET-53788) have been fixed in this update. This message was posted using Bugs notification tool by johnson.shi

Thanks. Where can I check the latest update?

@EnigmaticEcho,

Check the Releases/Downloads sections

Also, check Release Notes for Aspose.Cells for .NET and Java sections.
https://docs.aspose.com/cells/net/release-notes-2023/
https://docs.aspose.com/cells/java/release-notes-2023/

Hope, this helps a bit.