Coder Social home page Coder Social logo

Comments (10)

opoudjis avatar opoudjis commented on July 28, 2024

Word documents have done:

if node["height"] == "auto" || node["width"] == "auto"
        attrs[:height] = nil
        attrs[:width] = nil
      end

This means that if only one size parameter of the image is specified, neither is making it to Word, and the document is being resized to full size. That behaviour needs to be suppressed.

This code dates from metanorma/metanorma-ribose#12 (comment) . I was right that Word would not understand height="auto", but the recalculation of the image size that takes place via Html2Doc if height=0 means it does not need to anyway.

from html2doc.

opoudjis avatar opoudjis commented on July 28, 2024

Provide a "%" option to shrink size

Thought you'd just casually sneak a major feature addition in to an urgent bugfix ticket, did you?

No, this will not get actioned now. Demoted to medium priority.

from html2doc.

opoudjis avatar opoudjis commented on July 28, 2024

Percentage will be recognised, and converted on preprocessing to pixel value. @alexeymorozov This doesn't affect you, right?

from html2doc.

opoudjis avatar opoudjis commented on July 28, 2024

@alexeymorozov I'm moving image_resize(img, path, maxheight, maxwidth) and get_image_size(img, path) from html2doc to metanorma-utils anyway

from html2doc.

opoudjis avatar opoudjis commented on July 28, 2024

Still working on this in isodoc...

from html2doc.

alexeymorozov avatar alexeymorozov commented on July 28, 2024

@alexeymorozov I'm moving image_resize(img, path, maxheight, maxwidth) and get_image_size(img, path) from html2doc to metanorma-utils anyway

πŸ‘ The work doesn't intersect with vectory integration except of 1 line.

from html2doc.

alexeymorozov avatar alexeymorozov commented on July 28, 2024

@opoudjis Would you like the image_resize methods also to be moved to vectory?

from html2doc.

ronaldtse avatar ronaldtse commented on July 28, 2024

@alexeymorozov that’s probably a good idea. Any vector image manipulation or attribute reading should be in vectory.

from html2doc.

opoudjis avatar opoudjis commented on July 28, 2024

They are nothing to do with vectors, they apply to images generically. OTOH, you did move DataURI functionality to vectory as well, and that too is generic functionality. Don't care one way or the other...

from html2doc.

ronaldtse avatar ronaldtse commented on July 28, 2024

We might just extend Vectory to handle raster images as well...

from html2doc.

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.