Skip to content

Commit 91f998c

Browse files
committed
Fix assets generation
When we don't find asset in the default image definitions(image-definitions.json) we skip width and height parsing. Then the image generation fails. Now we set the correct size even we don't find default asset properties. ProgressNS/sidekick-feedback#199
1 parent 354b999 commit 91f998c

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

lib/services/project-data-service.ts

+8-8
Original file line numberDiff line numberDiff line change
@@ -143,16 +143,16 @@ export class ProjectDataService implements IProjectDataService {
143143
assetElement.filename === image.filename && path.basename(assetElement.directory) === path.basename(dirPath)
144144
);
145145

146-
if (assetItem) {
147-
if (image.size) {
148-
// size is basically <width>x<height>
149-
const [width, height] = image.size.toString().split(AssetConstants.sizeDelimiter);
150-
if (width && height) {
151-
image.width = +width;
152-
image.height = +height;
153-
}
146+
if (image.size) {
147+
// size is basically <width>x<height>
148+
const [width, height] = image.size.toString().split(AssetConstants.sizeDelimiter);
149+
if (width && height) {
150+
image.width = +width;
151+
image.height = +height;
154152
}
153+
}
155154

155+
if (assetItem) {
156156
if (!image.width || !image.height) {
157157
image.width = assetItem.width;
158158
image.height = assetItem.height;

0 commit comments

Comments
 (0)