email-builder-utils 1.1.20 → 1.1.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -196,6 +196,9 @@ async function convertImageBlock(blockData, cellWidthInPx) {
196
196
  borderRadius: borderRadius,
197
197
  borderColor,
198
198
  };
199
+ const image = await jimp_1.Jimp.read(imageUrl);
200
+ const originalWidth = image.bitmap.width;
201
+ const originalHeight = image.bitmap.height;
199
202
  // Add border styles to container for fallback clients
200
203
  const containerStyles = buildStyles({
201
204
  ...containerStyle,
@@ -204,7 +207,7 @@ async function convertImageBlock(blockData, cellWidthInPx) {
204
207
  perChanges: addPxOrPerToAttributes,
205
208
  pxChanges: addPxToAttributes,
206
209
  });
207
- const imageElement = `<img src="${imageUrl}" alt="${altText}" style="${imageTagStyles}" />`;
210
+ const imageElement = `<img src="${imageUrl}" alt="${altText}" style="${imageTagStyles}; max-width: ${originalWidth}px; max-height: ${originalHeight}px;" />`;
208
211
  const innerContainerWidth = ((typeof width === "string" ? parseInt(width.replace("%", "")) : width) /
209
212
  100) *
210
213
  (cellWidthInPx -
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "email-builder-utils",
3
- "version": "1.1.20",
3
+ "version": "1.1.21",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [