Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AddPicture doesn't set height #671

Closed
jcoliz opened this issue May 10, 2024 · 0 comments · Fixed by #672
Closed

AddPicture doesn't set height #671

jcoliz opened this issue May 10, 2024 · 0 comments · Fixed by #672
Assignees
Labels
bug This issue is a bug

Comments

@jcoliz
Copy link
Contributor

jcoliz commented May 10, 2024

Here's a failing test:

    [Test]
    public void AddPicture_sets_dimensions()
    {
        // Arrange
        var pres = new Presentation();
        var shapes = pres.Slides[0].Shapes;
        var image = TestHelper.GetStream("test-image-1.png");

        // Act
        shapes.AddPicture(image);

        // Assert
        var picture = (IPicture)shapes.Last();
        picture.Width.Should().Be(300);
        picture.Height.Should().Be(300);
    }

This fails because picture.Height is erroneously 0.

  Failed AddPicture_sets_dimensions [54 ms]
  Error Message:
   Expected picture.Height to be 300, but found 0 (difference of -300).

Only workaround I have right now is to load the image in FIRST as a bitmap to measure it, then load it in AGAIN as a shape. Would be happy to hear if there is another workaround to do this in a single load.

jcoliz added a commit to jcoliz/ShapeCrawler that referenced this issue May 10, 2024
@ashahabov ashahabov self-assigned this May 10, 2024
@ashahabov ashahabov added the bug This issue is a bug label May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants