news-catalyst / google-app-scripts

a collection of scripts for tinynews google docs add-ons
https://script.google.com/a/newscatalyst.org/d/1ILURq69o3cYUy6k1n1X6HwxdMfl9xWNhILYuZxgLfeblb3IR15WCMZSj/edit
1 stars 1 forks source link

Image dimensions are incorrect #388

Closed TylerFisher closed 2 years ago

TylerFisher commented 2 years ago

There are a couple issues happening here:

  1. Google provides the data in pt, not px, which results in a smaller number.
  2. The data is actually listing the width/height as drawn in the Google Doc, not the actual width and height of the file.

At minimum, we should convert pt to px. But if possible, we should read the width and height of the file, not the drawn img element in Google Docs.