Images not correctly proportionally sized on canvas [3.0.0]

Started by Dirk Roos, November 13, 2014, 11:06:55 AM

Previous topic - Next topic

Dirk Roos

When opening a model with images on a canvas, the images are not correctly sized (square instead of rectangle).

Same when adding a new image.

Phil Beauvoir

Hi, can you provide the exact steps to reproduce the problem? I just tested adding images to a Canvas and they look OK to me.
If you value and use Archi, please consider making a donation!
Ask your ArchiMate related questions to the ArchiMate Community's Discussion Board.

Dirk Roos

New installation
Create new model
Insert blank canvas
Insert image from palette (the bounding box is visible)
Choose source from properties tab

Image is stretched in the bounding box

Attached a screendump from 3.1.0 beta4 on linux (but the same with clean install of 3.0.0 on Windows7)

In this screendump a model was opened with images. The boundig boxes of all images is the default (almost square) square and all images are stretched.

Phil Beauvoir

Are the original images like this? I guess you select the image in the Canvas and clicked the "Default Size" button. Is this happening with all images? Perhaps the image is not reporting its correct size? How was the image made?
If you value and use Archi, please consider making a donation!
Ask your ArchiMate related questions to the ArchiMate Community's Discussion Board.

Phil Beauvoir

It's hard to know what's going in on in the screen-shot. Can you make a simple test model with one image that has the problem and put it here? I can't reproduce the problem.
If you value and use Archi, please consider making a donation!
Ask your ArchiMate related questions to the ArchiMate Community's Discussion Board.

Dirk Roos

I created a model both with 3.0.0 and 2.7.1. I added a blank canvas and inserted an image. ( see files attached)

In the 3.0.0 model a width and height is stored, but it is not the size of the image and the image shows wrong.
In the 2.7.1 model no dimensions where stored and the image is shown correctly.

When opening the 2.7.1 model in 3.0.0 the image is shown wrong. When saved from 3.0.0 the wrong dimensions are saved

3.0.0
    <element xsi:type="canvas:CanvasModel" id="0616b311" name="New Canvas">
      <child xsi:type="canvas:CanvasModelImage" id="e7a71abc" borderColor="#000000" imagePath="images/_O6Yv4GvkEeS22dGL2VHkBg.gif">
        <bounds x="38" y="29" width="200" height="150"/>
      </child>
    </element>

2.7.1
    <element xsi:type="archimate:ArchimateDiagramModel" id="918c4c93" name="Default View"/>
    <element xsi:type="canvas:CanvasModel" id="bccec08a" name="New Canvas">
      <child xsi:type="canvas:CanvasModelImage" id="9e69d4d8" borderColor="#000000" imagePath="images/_FehSYWvkEeSFTLD9etaqig.gif">
        <bounds x="39" y="24"/>
      </child>
    </element>

Phil Beauvoir

OK, I see the problem.

Archi 3 now stores the full dimensions of figures like this:

<bounds x="38" y="29" width="200" height="150"/>

In Archi 2.x, if a figure has a "default" size then width and height are not stored:

<bounds x="38" y="29"/>

The problem with this is that "default" only has a meaning to the application. If one were to take the .archimate file and try to do anything with it outside of Archi (say, convert it to another format) then figure widths and heights would be missing and meaningless. Also it's now possible to set a default width and height for new ArchiMate figures in Preferences and this has to be stored in the model file so it shows properly everywhere.

Having said that, an Image on a Canvas is a special case, since "default" means the image's width and height. Ideally, it's best to store the width and height on images too. A workaround is to select the affected images and press the "Default Size" button which will reset the sizes.

Alternatively I could provide a fix to ignore the Image width and height when loading. But this won't make it until Archi 3.1
If you value and use Archi, please consider making a donation!
Ask your ArchiMate related questions to the ArchiMate Community's Discussion Board.

Dirk Roos

Quote from: Phil Beauvoir on November 14, 2014, 10:51:16 AM
If one A workaround is to select the affected images and press the "Default Size" button which will reset the sizes.

Alternatively I could provide a fix to ignore the Image width and height when loading. But this won't make it until Archi 3.1

In 3.1.0 beta4 there is no button 'Default size' you mean 'Restore Defaults' in the preferences dialog?

In 3.1.x you might ignore the Image width and height when loading, but users must be aware that models with images on canvas that are openend in 3.0 will become somewhat corrupt.

Phil Beauvoir

No, I mean the button on the right of the toolbar, "Default Size". There are two buttons on the right the toolbar when a diagram is opened. One is "Default Size" and the other is "Reset Aspect Ratio".

I shall try and get a fix for 3.1 beta 5.
If you value and use Archi, please consider making a donation!
Ask your ArchiMate related questions to the ArchiMate Community's Discussion Board.

Dirk Roos

Yes, these buttons do help to restore the images on the canvas. Thanks.

Phil Beauvoir

Archi 3.1 will fix the issue as well. Any images with -1,-1 width/height will not be affected any more. 3.1 beta 6 has the fix.

Phil
If you value and use Archi, please consider making a donation!
Ask your ArchiMate related questions to the ArchiMate Community's Discussion Board.

Dirk Roos