Rotated images make Calc data entry slow

When we import an image into Calc, we often have to rotate the image slightly in order for the grid in the image to align with the grid in Calc. However, each time we enter data in a cell there is a noticeable delay between the time we press the Enter or Tab key and the time that the entry is finalized, for lack of a better word, and the next cell becomes active. This is a problem for fast typists and for some of our macros that are triggered by sheet events. This delay happens only if the images are rotated at a an angle, and not if the images are not rotated. It seems that if the angle is non-zero that the images are being rotated and re-drawn, but this does not seem to reasonable. A bug, perhaps? Our images are large, often 5 meg or larger. One of our transcribers noted:

A few months ago I ran tests on the Windows PC watching the system monitor with and without rotation. When the image was rotated there was a burst of memory activity. Without rotation, things were stable. That’s when I realized that they must be rotating the image every time we write when the image is rotated since rotating the image would require a significantly greater work space. I have no direct evidence that they are rotating the image every time, but I can’t come up with any other explanation based on what we’ve observed.

Better to rotate the images permanently in an image editor first.

GIMP works well, the measurement tool (Shift+M) allows you find the angle to enter into the Rotate (Shift+R) dialog, or you can just eyeball it while using the Rotate tool.

That’s not an option. Here’s a page we import. The grid on the page needs to line up with the cells on the spreadsheet. We have macros like Ctrl-Alt-A to slightly rotate the image anticlockwise, and Ctrl-Alt-Up to move the image slightly up etc. Every image has a slightly different orientation from the previous ones, and there’s no way we can estimate the amount of rotation necessary. Plus, we have volunteers all around the world who might find it difficult to use various image editors. With our system there’s one button to click to import an image and a couple of buttons or macros to adjust the image while they look at it. Our aim is to make things as simple as possible for our volunteers who are scattered around the world.

They are pretty hefty files. With that image in the background, each time I edit a cell it increases memory usage by about 50MB (from 130MB to 180MB).

If I rotate the image in Calc then memory usage increases during cell edit from 132MB to 186MB so not much different from non-rotated. I’m surprised. Until I save the file the memory usage is 170MB rising to 249MB during cell edit. A workaround might be to save early after rotation and possibly close LO and re-open the file to remove undo (of rotations) from memory.

Estimating the amount of rotation in an image editor for these images is not difficult as there are relatively straight lines across and down the pages, if they average at 0 degrees and 90 degrees then they should align with the grid.

I do know that we could try and straighten them with an external editor, but there are issues: If the page isn’t completely flat when scanned, the grids aren’t completely rectangular. Sometimes the grids are hand drawn. It also involves switching between different programs. With volunteers from around the world and using various systems, Windows, Linux, Macs, Chromebooks etc, we want to keep things as simple as possible. We’ve been doing this for three years, and adjusting the angles etc in Calc is the most practical method for working with these images. It’s just a puzzle to us why the images are re-drawn after every data entry. Interestingly, LInux users aren’t seeing the slow down that Windows users do. This is what our spreadsheet looks like:

It looks like a massive undertaking, kudos to all involved.

Calc used to have a setting for the number of Undo levels (might have saved a few tens of MB) but that has been moved into Expert Configuration which is not a place to play safely. According to Photoshop that 5MB file takes 54.1 MB of memory to display, each time a cell is edited Calc redraws the background to white then when entered back to image.

I don’t think that I am able to offer any real help, sorry. Cheers, Al

Thanks, Al. Your answers have helped us think in a new direction. We assumed that the image would be saved in memory and re-displayed from there. It seems that the image file is reloaded and rotated each time some data is entered. We’re going to investigate having Calc save the rotated image to a temp file and reloading it. We’re not concerned about the extra time after adjusting the angle if it speeds up the data entry response.

It seems that Version 7 is worse than version 6. This from one of our volunteers. Good is relative, all our versions of Calc have the slow response for rotated images:

I have been running Libra Calc ver 7.0.1 and 7.0.2, over the last few months, both slowed down my input speed.
It was very slow to show character on screen and I found I was missing some character because if it did not show before I hit the next one it did not show at all. It took me a while to realise it was Calc and not my PC.

I have gone back and loaded 6.4.6 and all is now good.

Thanks, Al. Your answers have helped us think in a new direction. We assumed that the image would be saved in memory and re-displayed from there. It seems that the image file is reloaded and rotated each time some data is entered. We’re going to investigate having Calc save the rotated image to a temp file and reloading it. We’re not concerned about the extra time after adjusting the angle if it speeds up the data entry response.