Skip to content

Commit

Permalink
fix(main): constraint default type to png for manifest icons
Browse files Browse the repository at this point in the history
fix #337
  • Loading branch information
onderceylan committed Jul 30, 2020
1 parent 8bfe9bb commit bf6f87c
Show file tree
Hide file tree
Showing 21 changed files with 65 additions and 64 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ $ pwa-asset-generator --help
-i --index Index HTML file path to automatically put splash screen and icon meta tags in
-a --path Path prefix to prepend for href links generated for meta tags
-v --path-override Override the path of images used in href/src tags of manifest and HTML files
-t --type Image type: png|jpg [default: jpg]
-t --type Image type: png|jpg [default: jpg - with the exception of manifest files]
-q --quality Image quality: 0...100 (Only for JPG) [default: 70]
-h --splash-only Only generate splash screens [default: false]
-c --icon-only Only generate icons [default: false]
Expand Down
120 changes: 60 additions & 60 deletions src/__snapshots__/main.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ Object {
Object {
"purpose": "maskable any",
"sizes": "192x192",
"src": "temp/manifest-icon-192.jpg",
"type": "image/jpg",
"src": "temp/manifest-icon-192.png",
"type": "image/png",
},
Object {
"purpose": "maskable any",
"sizes": "512x512",
"src": "temp/manifest-icon-512.jpg",
"type": "image/jpg",
"src": "temp/manifest-icon-512.png",
"type": "image/png",
},
],
"savedImages": Array [
Expand Down Expand Up @@ -261,15 +261,15 @@ Object {
"height": 192,
"name": "manifest-icon-192",
"orientation": null,
"path": "temp/manifest-icon-192.jpg",
"path": "temp/manifest-icon-192.png",
"scaleFactor": undefined,
"width": 192,
},
Object {
"height": 512,
"name": "manifest-icon-512",
"orientation": null,
"path": "temp/manifest-icon-512.jpg",
"path": "temp/manifest-icon-512.png",
"scaleFactor": undefined,
"width": 512,
},
Expand All @@ -292,14 +292,14 @@ Object {
Object {
"purpose": "maskable any",
"sizes": "192x192",
"src": "temp/manifest-icon-192.jpg",
"type": "image/jpg",
"src": "temp/manifest-icon-192.png",
"type": "image/png",
},
Object {
"purpose": "maskable any",
"sizes": "512x512",
"src": "temp/manifest-icon-512.jpg",
"type": "image/jpg",
"src": "temp/manifest-icon-512.png",
"type": "image/png",
},
],
"savedImages": Array [
Expand Down Expand Up @@ -339,15 +339,15 @@ Object {
"height": 192,
"name": "manifest-icon-192",
"orientation": null,
"path": "temp/manifest-icon-192.jpg",
"path": "temp/manifest-icon-192.png",
"scaleFactor": undefined,
"width": 192,
},
Object {
"height": 512,
"name": "manifest-icon-512",
"orientation": null,
"path": "temp/manifest-icon-512.jpg",
"path": "temp/manifest-icon-512.png",
"scaleFactor": undefined,
"width": 512,
},
Expand Down Expand Up @@ -1018,14 +1018,14 @@ Object {
Object {
"purpose": "maskable any",
"sizes": "192x192",
"src": "temp/manifest-icon-192.jpg",
"type": "image/jpg",
"src": "temp/manifest-icon-192.png",
"type": "image/png",
},
Object {
"purpose": "maskable any",
"sizes": "512x512",
"src": "temp/manifest-icon-512.jpg",
"type": "image/jpg",
"src": "temp/manifest-icon-512.png",
"type": "image/png",
},
],
"savedImages": Array [
Expand Down Expand Up @@ -1065,15 +1065,15 @@ Object {
"height": 192,
"name": "manifest-icon-192",
"orientation": null,
"path": "temp/manifest-icon-192.jpg",
"path": "temp/manifest-icon-192.png",
"scaleFactor": undefined,
"width": 192,
},
Object {
"height": 512,
"name": "manifest-icon-512",
"orientation": null,
"path": "temp/manifest-icon-512.jpg",
"path": "temp/manifest-icon-512.png",
"scaleFactor": undefined,
"width": 512,
},
Expand Down Expand Up @@ -1129,14 +1129,14 @@ Object {
Object {
"purpose": "maskable any",
"sizes": "192x192",
"src": "temp/manifest-icon-192.jpg",
"type": "image/jpg",
"src": "temp/manifest-icon-192.png",
"type": "image/png",
},
Object {
"purpose": "maskable any",
"sizes": "512x512",
"src": "temp/manifest-icon-512.jpg",
"type": "image/jpg",
"src": "temp/manifest-icon-512.png",
"type": "image/png",
},
],
"savedImages": Array [
Expand Down Expand Up @@ -1352,15 +1352,15 @@ Object {
"height": 192,
"name": "manifest-icon-192",
"orientation": null,
"path": "temp/manifest-icon-192.jpg",
"path": "temp/manifest-icon-192.png",
"scaleFactor": undefined,
"width": 192,
},
Object {
"height": 512,
"name": "manifest-icon-512",
"orientation": null,
"path": "temp/manifest-icon-512.jpg",
"path": "temp/manifest-icon-512.png",
"scaleFactor": undefined,
"width": 512,
},
Expand Down Expand Up @@ -1414,14 +1414,14 @@ Object {
Object {
"purpose": "maskable any",
"sizes": "192x192",
"src": "temp/manifest-icon-192.jpg",
"type": "image/jpg",
"src": "temp/manifest-icon-192.png",
"type": "image/png",
},
Object {
"purpose": "maskable any",
"sizes": "512x512",
"src": "temp/manifest-icon-512.jpg",
"type": "image/jpg",
"src": "temp/manifest-icon-512.png",
"type": "image/png",
},
],
"savedImages": Array [
Expand Down Expand Up @@ -1637,15 +1637,15 @@ Object {
"height": 192,
"name": "manifest-icon-192",
"orientation": null,
"path": "temp/manifest-icon-192.jpg",
"path": "temp/manifest-icon-192.png",
"scaleFactor": undefined,
"width": 192,
},
Object {
"height": 512,
"name": "manifest-icon-512",
"orientation": null,
"path": "temp/manifest-icon-512.jpg",
"path": "temp/manifest-icon-512.png",
"scaleFactor": undefined,
"width": 512,
},
Expand All @@ -1670,14 +1670,14 @@ Object {
Object {
"purpose": "maskable any",
"sizes": "192x192",
"src": "temp/manifest-icon-192.jpg",
"type": "image/jpg",
"src": "temp/manifest-icon-192.png",
"type": "image/png",
},
Object {
"purpose": "maskable any",
"sizes": "512x512",
"src": "temp/manifest-icon-512.jpg",
"type": "image/jpg",
"src": "temp/manifest-icon-512.png",
"type": "image/png",
},
],
"savedImages": Array [
Expand Down Expand Up @@ -1717,15 +1717,15 @@ Object {
"height": 192,
"name": "manifest-icon-192",
"orientation": null,
"path": "temp/manifest-icon-192.jpg",
"path": "temp/manifest-icon-192.png",
"scaleFactor": undefined,
"width": 192,
},
Object {
"height": 512,
"name": "manifest-icon-512",
"orientation": null,
"path": "temp/manifest-icon-512.jpg",
"path": "temp/manifest-icon-512.png",
"scaleFactor": undefined,
"width": 512,
},
Expand Down Expand Up @@ -1756,14 +1756,14 @@ Object {
Object {
"purpose": "maskable any",
"sizes": "192x192",
"src": "temp/manifest-icon-192.jpg",
"type": "image/jpg",
"src": "temp/manifest-icon-192.png",
"type": "image/png",
},
Object {
"purpose": "maskable any",
"sizes": "512x512",
"src": "temp/manifest-icon-512.jpg",
"type": "image/jpg",
"src": "temp/manifest-icon-512.png",
"type": "image/png",
},
],
"savedImages": Array [
Expand Down Expand Up @@ -1803,15 +1803,15 @@ Object {
"height": 192,
"name": "manifest-icon-192",
"orientation": null,
"path": "temp/manifest-icon-192.jpg",
"path": "temp/manifest-icon-192.png",
"scaleFactor": undefined,
"width": 192,
},
Object {
"height": 512,
"name": "manifest-icon-512",
"orientation": null,
"path": "temp/manifest-icon-512.jpg",
"path": "temp/manifest-icon-512.png",
"scaleFactor": undefined,
"width": 512,
},
Expand Down Expand Up @@ -2070,14 +2070,14 @@ Object {
Object {
"purpose": "maskable any",
"sizes": "192x192",
"src": "./my-custom-path-override/manifest-icon-192.jpg",
"type": "image/jpg",
"src": "./my-custom-path-override/manifest-icon-192.png",
"type": "image/png",
},
Object {
"purpose": "maskable any",
"sizes": "512x512",
"src": "./my-custom-path-override/manifest-icon-512.jpg",
"type": "image/jpg",
"src": "./my-custom-path-override/manifest-icon-512.png",
"type": "image/png",
},
],
"savedImages": Array [
Expand Down Expand Up @@ -2293,15 +2293,15 @@ Object {
"height": 192,
"name": "manifest-icon-192",
"orientation": null,
"path": "temp/manifest-icon-192.jpg",
"path": "temp/manifest-icon-192.png",
"scaleFactor": undefined,
"width": 192,
},
Object {
"height": 512,
"name": "manifest-icon-512",
"orientation": null,
"path": "temp/manifest-icon-512.jpg",
"path": "temp/manifest-icon-512.png",
"scaleFactor": undefined,
"width": 512,
},
Expand Down Expand Up @@ -2332,14 +2332,14 @@ Object {
Object {
"purpose": "any",
"sizes": "192x192",
"src": "manifest-icon-192.jpg",
"type": "image/jpg",
"src": "manifest-icon-192.png",
"type": "image/png",
},
Object {
"purpose": "any",
"sizes": "512x512",
"src": "manifest-icon-512.jpg",
"type": "image/jpg",
"src": "manifest-icon-512.png",
"type": "image/png",
},
],
"savedImages": Array [
Expand Down Expand Up @@ -2379,15 +2379,15 @@ Object {
"height": 192,
"name": "manifest-icon-192",
"orientation": null,
"path": "temp/manifest-icon-192.jpg",
"path": "temp/manifest-icon-192.png",
"scaleFactor": undefined,
"width": 192,
},
Object {
"height": 512,
"name": "manifest-icon-512",
"orientation": null,
"path": "temp/manifest-icon-512.jpg",
"path": "temp/manifest-icon-512.png",
"scaleFactor": undefined,
"width": 512,
},
Expand All @@ -2410,14 +2410,14 @@ Object {
Object {
"purpose": "maskable any",
"sizes": "192x192",
"src": "./my-custom-path-override/manifest-icon-192.jpg",
"type": "image/jpg",
"src": "./my-custom-path-override/manifest-icon-192.png",
"type": "image/png",
},
Object {
"purpose": "maskable any",
"sizes": "512x512",
"src": "./my-custom-path-override/manifest-icon-512.jpg",
"type": "image/jpg",
"src": "./my-custom-path-override/manifest-icon-512.png",
"type": "image/png",
},
],
"savedImages": Array [
Expand Down Expand Up @@ -2457,15 +2457,15 @@ Object {
"height": 192,
"name": "manifest-icon-192",
"orientation": null,
"path": "temp/manifest-icon-192.jpg",
"path": "temp/manifest-icon-192.png",
"scaleFactor": undefined,
"width": 192,
},
Object {
"height": 512,
"name": "manifest-icon-512",
"orientation": null,
"path": "temp/manifest-icon-512.jpg",
"path": "temp/manifest-icon-512.png",
"scaleFactor": undefined,
"width": 512,
},
Expand Down
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ $ pwa-asset-generator --help
-i --index Index HTML file path to automatically put splash screen and icon meta tags in
-a --path Path prefix to prepend for href links generated for meta tags
-v --path-override Override the path of images used in href/src tags of manifest and HTML files
-t --type Image type: png|jpg [default: jpg]
-t --type Image type: png|jpg [default: jpg - with the exception of manifest files]
-q --quality Image quality: 0...100 (Only for JPG) [default: 70]
-h --splash-only Only generate splash screens [default: false]
-c --icon-only Only generate icons [default: false]
Expand Down
2 changes: 1 addition & 1 deletion src/helpers/meta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const generateOutputPath = (
: indexHtmlPath) as string;

if (pathOverride) {
return `${pathOverride}/${imageName}.${type}`;
return `${pathOverride}/${imageName}.${isManifest ? 'png' : type}`;
}

if (pathPrefix && !isManifest) {
Expand Down
Loading

0 comments on commit bf6f87c

Please sign in to comment.