[Solved] Change images to original size & centered in cell
[Solved] Change images to original size & centered in cell
This is a "2part" question.
I've got a game-list, that I've imported to OpenOffice.
My problem is that the images isn't original sizes and not centred in the cells, they are "free floating"..
Is there anyway to modify them ALL, instead of one at a time?
I got 900 of them...
2. How do I center the image, I haven't found any center function..
I've got a game-list, that I've imported to OpenOffice.
My problem is that the images isn't original sizes and not centred in the cells, they are "free floating"..
Is there anyway to modify them ALL, instead of one at a time?
I got 900 of them...
2. How do I center the image, I haven't found any center function..
Last edited by Nemesis on Fri Jul 24, 2020 7:40 am, edited 1 time in total.
Openoffice 4.1.6 on Windows 10
Re: Change ALL images to original size & centered in cell
The images are not located inside a Cell, but they are located on an independent graphic Layer.
Trere are Macro examples, how to align pictures to a cell virtually.
viewtopic.php?f=9&t=34544
Trere are Macro examples, how to align pictures to a cell virtually.
viewtopic.php?f=9&t=34544
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
Re: Change ALL images to original size & centered in cell
1. Use IrfanView to batch resize each image to the same pixel count so step 2 works.
2. Use IrfanView to create a vertical or horizontal panorama image of all 900 images. You now have a long strip of all 900 images.
3. Insert the panorama image and position as required. Set row height or column width to the image size so everything lines up immediately.
Doing 900 full size images will give a huge file - minimise the pixel count at step 1 so as to reduce the file size. It may help to do 100 images at a time for 9 files.
See [Tutorial] Some useful hints on using images.
Showing that a problem has been solved helps others searching so, if your problem is now solved, please view your first post in this thread and click the Edit button (top right in the post) and add [Solved] in front of the subject.
2. Use IrfanView to create a vertical or horizontal panorama image of all 900 images. You now have a long strip of all 900 images.
3. Insert the panorama image and position as required. Set row height or column width to the image size so everything lines up immediately.
Doing 900 full size images will give a huge file - minimise the pixel count at step 1 so as to reduce the file size. It may help to do 100 images at a time for 9 files.
See [Tutorial] Some useful hints on using images.
Showing that a problem has been solved helps others searching so, if your problem is now solved, please view your first post in this thread and click the Edit button (top right in the post) and add [Solved] in front of the subject.
LO 6.4.4.2, Windows 10 Home 64 bit
See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.
Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.
Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
Re: Change ALL images to original size & centered in cell
That macro worked great thx.Zizi64 wrote:...
Openoffice 4.1.6 on Windows 10
Re: Change ALL images to original size & centered in cell
The images in the cells are original 1.72x2.43 cm but are 0.93x1.29 in the cells.John_Ha wrote:1. Use IrfanView to batch resize
..
To get one to the original size, I right-click on the image and select "Original Size"..
There must be a way to get the calc to fix all at once..
I tried making a macro, but the action wasn't recorded.
Making one long image isn't a solution, since then I can't sort the table..
Openoffice 4.1.6 on Windows 10
Re: Change ALL images to original size & centered in cell
You must WRITE your macro (based on the API functions) if you want to work efficiently with the macros.I tried making a macro, but the action wasn't recorded.
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
Re: Change ALL images to original size & centered in cell
I almost guessed that, that's why I tried to record one to see what to write. I have no idea how to get it to restore the images..Zizi64 wrote:You must WRITE your macro (based on the API functions) if you want to work efficiently with the macros.I tried making a macro, but the action wasn't recorded.
Openoffice 4.1.6 on Windows 10
Re: Change ALL images to original size & centered in cell
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
Re: Change ALL images to original size & centered in cell
I've seen the code, but since I don't know the command to set the original size, and the code is above my understanding..
Openoffice 4.1.6 on Windows 10
Re: Change ALL images to original size & centered in cell
Extract content.xml from the .ods file and use a simple Regular Expression (see the tutorial) Find and Replace to change all sizes to what you want. One search will do all 900.Nemesis wrote:I don't know the command to set the original size, and the code is above my understanding..
This is from a spreadsheet with two images. The first is reduced while the second is full size. svg:width="205.69mm" svg:height="292.24mm" sets the image size while svg:x="13.85mm" svg:y="124.92mm" sets the location of the image top left corner on the page.
Code: Select all
<draw:frame draw:z-index="0" draw:name="Image 1" draw:style-name="gr1" draw:text-style-name="P1" svg:width="205.69mm" svg:height="292.24mm" svg:x="13.85mm" svg:y="124.92mm">
<draw:image xlink:href="Pictures/1000000000000B200000085887098DB214D00F46.jpg" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad" loext:mime-type="image/jpeg">
<text:p/>
</draw:image>
</draw:frame>
<draw:frame draw:z-index="1" draw:name="Image 2" draw:style-name="gr1" draw:text-style-name="P1" svg:width="784.15mm" svg:height="567.36mm" svg:x="13.85mm" svg:y="451.59mm">
<draw:image xlink:href="Pictures/1000000000000B200000085841BC8802082C6B82.jpg" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad" loext:mime-type="image/jpeg">
<text:p/>
</draw:image>
</draw:frame>
Edit: Edit to correct statement. Note that images in a spreadsheet are located relative to the page or cell location and are not anchored to cell content so images will not move if you sort data. But, if you anchor to a cell and add a row so the cell moves, the image will move. See the Calc Manual for details. |
If you want images to move with data then it may be better to use a simple database with a report for the sorted data and associated images.
Last edited by John_Ha on Thu Jul 23, 2020 8:33 pm, edited 3 times in total.
LO 6.4.4.2, Windows 10 Home 64 bit
See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.
Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.
Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
Re: Change ALL images to original size & centered in cell
Which one?John_Ha wrote:(see the tutorial)Nemesis wrote:I don't know the command to set the original size, and the code is above my understanding..
Openoffice 4.1.6 on Windows 10
Re: Change ALL images to original size & centered in cell
The comment applies to regular expressions. As you cannot understand macros do it a different way you can understand.
However, I think it is all moot. Does a sort move the images when the data moves? It does not move the images in my test file.
However, I think it is all moot. Does a sort move the images when the data moves? It does not move the images in my test file.
LO 6.4.4.2, Windows 10 Home 64 bit
See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.
Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.
Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
Re: Change ALL images to original size & centered in cell
John_Ha wrote:The comment applies to regular expressions. As you cannot understand macros do it a different way you can understand.
However, I think it is all moot. Does a sort move the images when the data moves? It does not move the images in my test file.
I meant you wrote "see the tutorial" but I don't know where it is (about extracting content.xml)
If the images are.. Wait a moment, you're right, wtf ?, If an image is anchored to a cell, it should move when the cell is moving..
.. At least in my pretty little world...
Openoffice 4.1.6 on Windows 10
Re: Change ALL images to original size & centered in cell
Learn the difference between a cell and the content within a cell.Nemesis wrote:If an image is anchored to a cell, it should move when the cell is moving..
.. At least in my pretty little world...
LO 6.4.4.2, Windows 10 Home 64 bit
See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.
Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.
Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
Re: Change ALL images to original size & centered in cell
I did this way back with excel....
Is there no way to get the image to the cell-content, or use some external link?
Is there no way to get the image to the cell-content, or use some external link?
Openoffice 4.1.6 on Windows 10
Re: Change ALL images to original size & centered in cell
Cells never moving. The Cell A1 always will be located in the left-top corner. Only the cell contents moving.If an image is anchored to a cell, it should move when the cell is moving..
When you delete the row 7, then the seventh row will not missed: only the contents will be deleted, and the contents of the other rows will be shifted "up".
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
Re: Change ALL images to original size & centered in cell
Well, let's get back to the original question, getting the images to original size..
Openoffice 4.1.6 on Windows 10
Re: Change ALL images to original size & centered in cell
Unfortunatelly the API command
can not work with the string parameter "Size" nor "Height" nor "Width".
https://www.openoffice.org/api/docs/com ... State.html
Code: Select all
.setPropertyToDefault
https://www.openoffice.org/api/docs/com ... State.html
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
Re: Change ALL images to original size & centered in cell
Gee.. never thought it would be this complicated.
I think I did all of this way back with Microsoft Excel in 07..
Well, I did at least get my question answered.
Thx for the help..
I think I did all of this way back with Microsoft Excel in 07..
Well, I did at least get my question answered.
Thx for the help..
Openoffice 4.1.6 on Windows 10
Re: [Solved] Change images to original size & centered in ce
The solution is not in the command "setPropertyToDefault", but it is in the relation of the methods/properties
and the
The "oItem.Graphic.Size100thMM." contains the default size values of the image, and the "oItem.Size." contains the resized values (of the frame??).
Here is a sample file with the embedded macro code.
It works fine in my permanently installed LibreOffice 6.1.6 and in the AOO 4.1.5 portable version.
Code: Select all
oItem.Graphic.Size100thMM.Width
oItem.Graphic.Size100thMM.Height
Code: Select all
oItem.Size.Width
oItem.Size.Height
Here is a sample file with the embedded macro code.
It works fine in my permanently installed LibreOffice 6.1.6 and in the AOO 4.1.5 portable version.
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.