Make transform optional for ImageRuns #1456
Replies: 2 comments 2 replies
-
Its not possible im afraid. Node.js doesn't actually know how big the photo is, it just has the raw image data. In a browser environment, the size is known, but for compatibility between node and browser, we cant have separate implementations. This is why the size has to be set. |
Beta Was this translation helpful? Give feedback.
-
I had the same situation. I have images that would always be 3" wide, but height would be variable. I used some JavaScript right before My image is wrapped in a
Then in the ImageRun, the transformation code is thus:
Of course, I could have made Hope this helps. |
Beta Was this translation helpful? Give feedback.
-
It can be difficult to the know the exact demotions of an image particularly if the image is a buffers or base64 encoded. When I try to add an
ImageRun
without atransform.width
andtransform.height
the document is corrupt and won't open. It would be nice to be able to place anImageRun
without any transformations at all. It would also be nice to specify either awidth
or aheight
and allow the image to scale proportionally—similar to the way CSS handles it.Beta Was this translation helpful? Give feedback.
All reactions