Archi Forum

Archi => Archi Development => Topic started by: Dirk Roos on November 13, 2014, 11:06:55 AM

Title: Images not correctly proportionally sized on canvas [3.0.0]
Post by: Dirk Roos on November 13, 2014, 11:06:55 AM
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.
Title: Re: Images not correctly proportionally sized on canvas [3.0.0]
Post by: Phil Beauvoir on November 13, 2014, 11:29:13 AM
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.
Title: Re: Images not correctly proportionally sized on canvas [3.0.0]
Post by: Dirk Roos on November 13, 2014, 12:18:20 PM
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.
Title: Re: Images not correctly proportionally sized on canvas [3.0.0]
Post by: Phil Beauvoir on November 13, 2014, 13:01:05 PM
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?
Title: Re: Images not correctly proportionally sized on canvas [3.0.0]
Post by: Phil Beauvoir on November 14, 2014, 09:21:29 AM
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.
Title: Re: Images not correctly proportionally sized on canvas [3.0.0]
Post by: Dirk Roos on November 14, 2014, 10:04:14 AM
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>
Title: Re: Images not correctly proportionally sized on canvas [3.0.0]
Post by: Phil Beauvoir on November 14, 2014, 10:51:16 AM
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
Title: Re: Images not correctly proportionally sized on canvas [3.0.0]
Post by: Dirk Roos on November 14, 2014, 11:18:02 AM
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.
Title: Re: Images not correctly proportionally sized on canvas [3.0.0]
Post by: Phil Beauvoir on November 14, 2014, 13:26:48 PM
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.
Title: Re: Images not correctly proportionally sized on canvas [3.0.0]
Post by: Dirk Roos on November 24, 2014, 14:05:31 PM
Yes, these buttons do help to restore the images on the canvas. Thanks.
Title: Re: Images not correctly proportionally sized on canvas [3.0.0]
Post by: Phil Beauvoir on November 24, 2014, 14:09:51 PM
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
Title: Re: Images not correctly proportionally sized on canvas [3.0.0]
Post by: Dirk Roos on December 05, 2014, 07:42:42 AM
Thanks, i will check in the new version.