Giter Site home page Giter Site logo

Comments (8)

kapkanov avatar kapkanov commented on August 20, 2024

You should encode image via base64

with open("path/to/image.jpg", "rb") as img_file: 
  encoded = base64.b64encode(img_file.read()).decode('ascii')
Session1.activityImage("data:image/jpeg;base64, "+str(encoded))

from pymsteams.

reesehopkins avatar reesehopkins commented on August 20, 2024

Thanks @apolivin, this works for me. However, I get a 400 error when the image is too large. This might be related to #34

from pymsteams.

GitRon avatar GitRon commented on August 20, 2024

The image within this activity is tiny. Is there a way to post a properly-sized image?

from pymsteams.

GitRon avatar GitRon commented on August 20, 2024

OK, maybe you could update the docs that you can easily use HTML for larger images? 🙈 Thx for the great package!

from pymsteams.

LeonardoSanBenitez avatar LeonardoSanBenitez commented on August 20, 2024

You can include an image as HTML, in a text block, as follows:

myTeamsMessage.text("<img src="data:image/png;base64, iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==" alt="Red dot" />")

from pymsteams.

GitRon avatar GitRon commented on August 20, 2024

@LeonardoSanBenitez I know how to do it now but it's not mentioned in the docs 😃

from pymsteams.

chongjae avatar chongjae commented on August 20, 2024

I want to attach about 119Kb png file.
But, when i sent image, teams show below msg.

This message is too long to display here. Please visit the external source app to view the message.

How can i attach image?

from pymsteams.

rveachkc avatar rveachkc commented on August 20, 2024

I want to attach about 119Kb png file. But, when i sent image, teams show below msg.

This message is too long to display here. Please visit the external source app to view the message.

How can i attach image?

It's a limitation of the api. The error message is suggesting you make the image available via external service, then link to it.

from pymsteams.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.