Git Product home page Git Product logo

Comments (3)

scanny avatar scanny commented on September 28, 2024

I would. Needs to have tests though. The ones for Run.add_break() should be good models:

Let me know if you need help getting started with the testing. I've been meaning to document it better, just haven't gotten to it yet.

Pull needs to be on a distinct new branch on your fork. feature/run-add-picture let's say. You should expect that you'll need to make adjustments based on feedback to your initial pull request. Once or twice should do it :) Those changes should be in the same commits so you should be familiar with rebasing. The acceptance test should be in the first commit, by itself. Then one commit for each test/code pair. Maybe only one of those for this, we'll have to see how it goes :)

Interface should model docx.api.Document.add_picture(), i.e. image descriptor can be path or file-like object and dimensions can be specified, defaulted, or scaled on width or height. You should be able to get that from add_picture() by copy and paste. Shame on me for not factoring that bit out into a separate method somewhere, I'll clean that up later.

Let me know if you have any questions on the specifics :)

from python-docx.

scanny avatar scanny commented on September 28, 2024

Analysis notes

Need access to the part in order to create the relationship to the image part. This implies that Run, Paragraph, Body, Table, Row, Col, and Cell all need Parented as a base class.

from python-docx.

scanny avatar scanny commented on September 28, 2024

feature Run.add_picture() added in release 0.7.1 today.

from python-docx.

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.