Categories > OpenTBS with ODT >

replacing picture, can the new picture automatically have its own size?

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: hemocyanin
Date: 2013-11-04
Time: 22:45

replacing picture, can the new picture automatically have its own size?

I'm replacing a picture in text document (can a picture just be added? I don't really need to do a replace).  I'll call the picture in my template "original" and the replacement "new".  I notice that the new picture is always made the same size as the original.  Is there a way to set this up so that the new picture gets its own size rather than that of the original?  I'm not going to be able to predict the size of the picture.

----PHP---------
$topPic=path/fileName.eps;

----template----
[onshow.topPic;ope=changepic]
By: Skrol29
Date: 2013-11-04
Time: 22:55

Re: replacing picture, can the new picture automatically have its own size?

Hi,

You can adjust the size, see parameter "adjust"
http://www.tinybutstrong.com/plugins/opentbs/tbs_plugin_opentbs.html#pic
By: hemocyanin
Date: 2013-11-05
Time: 19:10

Re: replacing picture, can the new picture automatically have its own size?

I've tried the "adjust=100%" setting.  If the replacement image is larger than the original, it gets shrunk to the dimensions of the original, which leads to distortion.  If the replacement image is smaller than the original, it gets expanded to the original image's size, which leads to distortion.

What I need, is for the new image to get its own size and be neither shrunk nor expanded in relation to the original.

Is this possible?  If so, what setting do I need?

Is it possible to just add an image because I don't really need to do replacement?
By: Skrol29
Date: 2013-11-07
Time: 01:24

Re: replacing picture, can the new picture automatically have its own size?

> What I need, is for the new image to get its own size and be neither shrunk nor expanded in relation to the original.

Unfortunately it is not that easy with ODT and DOCX : the picture is display within a frame in the main body of the document.
The frame has a size which is not expressed in pixel, but rather in human unities. Then the frame display the linked picture using a scale.
Unfortunately, when the document is edited, the conversion from the pixel to the frame unity may be different from a computer to another computer.

So the feature does not exist for now.

> Is it possible to just add an image because I don't really need to do replacement?

It is necessary to have an existing frame for the picture because a lot of parameters comes with the frame: scale, borders, opacity, ...