@capillarytech/creatives-library 7.12.92 → 7.12.94
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.
package/package.json
CHANGED
|
@@ -130,16 +130,16 @@ export const getCdnUrl = ({
|
|
|
130
130
|
try {
|
|
131
131
|
switch (transformationParam) {
|
|
132
132
|
case "height":
|
|
133
|
-
if (transformationParamVal === SPECIFIED &&
|
|
133
|
+
if (transformationParamVal === SPECIFIED && height) {
|
|
134
134
|
newUrl += `${transformationParam}=${height},`;
|
|
135
|
-
} else if(isNumber(transformationParamVal)) {
|
|
135
|
+
} else if(transformationParamVal !== SPECIFIED && isNumber(transformationParamVal)) {
|
|
136
136
|
newUrl += `${transformationParam}=${transformationParamVal},`;
|
|
137
137
|
}
|
|
138
138
|
break;
|
|
139
139
|
case "width":
|
|
140
|
-
if (transformationParamVal === SPECIFIED &&
|
|
140
|
+
if (transformationParamVal === SPECIFIED && width) {
|
|
141
141
|
newUrl += `${transformationParam}=${width},`;
|
|
142
|
-
} else if(isNumber(transformationParamVal)) {
|
|
142
|
+
} else if(transformationParamVal !== SPECIFIED && isNumber(transformationParamVal)) {
|
|
143
143
|
newUrl += `${transformationParam}=${transformationParamVal},`;
|
|
144
144
|
}
|
|
145
145
|
break;
|
|
@@ -149,7 +149,7 @@ export const getCdnUrl = ({
|
|
|
149
149
|
}
|
|
150
150
|
break;
|
|
151
151
|
case "quality":
|
|
152
|
-
if (transformationParamVal === QUALITY_TYPE?.DECREASE &&
|
|
152
|
+
if (transformationParamVal === QUALITY_TYPE?.DECREASE && QUALITY) {
|
|
153
153
|
newUrl += `${transformationParam}=${QUALITY},`;
|
|
154
154
|
}
|
|
155
155
|
break;
|
|
@@ -179,8 +179,8 @@ export const updateImagesInHtml = (htmlContents) => {
|
|
|
179
179
|
const imageSrc = element.getAttribute("src");
|
|
180
180
|
const isAsset = regex.test(imageSrc);
|
|
181
181
|
if (isAsset) {
|
|
182
|
-
const height =
|
|
183
|
-
const width =
|
|
182
|
+
const height = element.getAttribute("height");
|
|
183
|
+
const width = element.getAttribute("width");
|
|
184
184
|
const newUrl = getCdnUrl({
|
|
185
185
|
url: imageSrc,
|
|
186
186
|
height,
|