Same excel file have different cell width with image on different machines

@Hugo_Freixo,
Please try our latest version/fix: Aspose.Cells for Java v19.5.7:
aspose-cells-19.5.7.zip (6.5 MB)

Your issue should be fixed in it.

Let us know your feedback.

Hi ahsaniqbalsidiqui,
I tested my scenario using the fixed build you sent, but what happens is that in one of the machines I tested some images are exported with the wrong width (they lose the width/height ratio) Do you have any idea why this happens?

Attached are the generated files with this scenario. docs.zip (4.5 MB)

Best regards,
Hugo Freixo

@Hugo_Freixo,
I have opened your both output files in macOS but afraid to share that no issue is observed as both the images are placed properly in the cell. I also tried the sample code with the latest version 19.5.7 again in my environment and created an output file. It also contains proper image placement in the cell. Could you please explain the issue in detail along with images after using this latest version?

Hi @ahsaniqbalsidiqui,
The problem is the actual images width. One is wider than the other and it loses the aspect ratio. These files were generated with the same code in different machines.

Screenshot 2019-06-19 at 09.19.27.jpg (1.3 MB)
You can see in this image that one’s width is 10,11’’ and the other is 11,56’’. The last one has a Scale width of 11% instead of 9%

Best regards,
Hugo Freixo

@Hugo_Freixo,
Thank you for sharing the issue details. Could you please provide us the environment details of the machines which are causing different results? It may help us to reproduce the issue here and provide assistance.

Hi @ahsaniqbalsidiqui,
Here is the information:
ERROR MACHINE

UBUNTU:
NAME=“Ubuntu”
VERSION=“14.04.2 LTS, Trusty Tahr”
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME=“Ubuntu 14.04.2 LTS”
VERSION_ID=“14.04”
HOME_URL=“http://www.ubuntu.com/
SUPPORT_URL=“http://help.ubuntu.com/
BUG_REPORT_URL=“Bugs : Ubuntu
JAVA:
java version “1.8.0_171”
Java™ SE Runtime Environment (build 1.8.0_171-b11)
Java HotSpot™ 64-Bit Server VM (build 25.171-b11, mixed mode)

OK MACHINE

UBUNTU:
NAME=“Ubuntu”
VERSION=“16.04.5 LTS (Xenial Xerus)”
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME=“Ubuntu 16.04.5 LTS”
VERSION_ID=“16.04”
HOME_URL=“http://www.ubuntu.com/
SUPPORT_URL=“http://help.ubuntu.com/
BUG_REPORT_URL=“Bugs : Ubuntu
VERSION_CODENAME=xenial
UBUNTU_CODENAME=xenial
JAVA:
java version “1.8.0_211”
Java™ SE Runtime Environment (build 1.8.0_211-b12)
Java HotSpot™ 64-Bit Server VM (build 25.211-b12, mixed mode)

If you need any extra information, feel free to ask.
Best regards,
Hugo Freixo

@Hugo_Freixo,
Thank you for providing details. Please spare us time to establish the environment for testing this issue. We will write back here once the environment is established and the issue is reproduced.

@Hugo_Freixo,
Could you please identify the exact ISO file for the ERROR MACHINE from the following links? If it is not in the list, please share from any other source which you have used.

Hi @ahsaniqbalsidiqui,

Here’s the requested information:
The ISO file for the ERROR MACHINE is 64-bit PC (AMD64) server install image in the first link.
MicrosoftTeams-image.png (62.9 KB)

Best regards,
Hugo Freixo

@Hugo_Freixo,
Thank you for the confirmation. Please spare us little time to establish the environment and test the issue. We will write back here as soon as some feedback is ready to share with you.

Hi @ahsaniqbalsidiqui,

Is there any update on this issue?

Best regards,
Hugo Freixo

@Hugo_Freixo,
I am afraid it is not resolved yet. We will inform you as soon as some update will be available.

@Hugo_Freixo,
We have investigated the issue in detail and observed that this issue is due to difference in fonts. You may copy all fonts of the working machine to another machine. The issue should be caused that referred fonts in the file could not be found. Please give it a try and share the feedback.

Hi @ahsaniqbalsidiqui,

I removed all the fonts from the failing machine and copied all the ones from the working machine.
The pixel difference between cells does not exist anymore. Thank you very much.
We’re still waiting on a fix for another issue Different cell sizes retrieved on different machines (MacOS and Windows) for same Excel file - #12 by amjad.sahi

How long will it take to solve?
How can I follow the issue’s progress? You said the issue was logged as CELLSJAVA-42920 - Same excel file have different cell size on different machines, but I don’t know how to follow it.

Best regards,
Hugo Freixo

@Hugo_Freixo,
We are glad to know that one of your issues is resolved by copying fonts from the working machine. Regarding the issue CELLSJAVA-42920, neither it is resolved nor any ETA is available as it is still under investigation. You may keep on checking the status of the ticket and we will also write back here as soon as any update is available for this issue.

We are sorry for any inconvenience caused to you in this regard.

@Hugo_Freixo,
We have investigated CELLSJAVA-42920 further and like to share that we have got the same result on macOS and Window. Screenshots are attached for your reference.
od.jpg (68.3 KB)
autofit.jpg (277.7 KB)

Hi @ahsaniqbalsidiqui,

That’s good news.Did you get that with your Development version or did you use a released version?

Best regards,
Hugo Freixo

@Hugo_Freixo,
Both the versions are same so you can test it with latest version of API and let us know your feedback.

Hi @ahsaniqbalsidiqui,

I tested the code you sent me and the autofit behaves the same way on both machines (but I believe happens because of the Font change I made last week).
Also, I tested the Images scenario and they the results on both machines are equal. But it seems that the image loses its width/height ratio.

image.jpg (665.0 KB)

Original size: 106,67’’ / 60’’ ~ 1,777833333
Values I use to set cell size: 971px / 546px ~ 1,778388278
Actual cell values: 832px /409px ~ 2,034229829
Picture size: =11,56’’ / 5,68’’ ~ 2,035211268

Shouldn’t the image keep the width height ratio?

Best regards,
Hugo Freixo

@Hugo_Freixo,
Well, this seems to be the difference in the behaviour of Excel for Windows 7 and macOS (Mojave) as shown in the attached image. You can see that in Windows, the ratio of height to width is the same as the original image. Images created in Ubuntu and CentOS are compared separately but in all cases, Excel for Windows has proper image size and Excel for macOS has a different ratio for height to width.

Screenshot 2019-08-06 at 12.07.43 AM.jpg (1.1 MB)