electron-icon-generator icon indicating copy to clipboard operation
electron-icon-generator copied to clipboard

Problem while generating icons in W10

Open fjrial opened this issue 6 years ago • 1 comments

While trying to generate a set of icons in W10, I get this error about 57.png image not found..

Icons/png folder is populated with a lot of png images, but that 57.png does not exist.. Even if I create it, and try to run electron-icon-generator it outputs the same error ( I guess that the icons folder is removed on a new run of the command)

C:\Users\Jrial\Documents\Imaxes AFF>electron-icon-generator favicon_blanco.png created png created win created mac icons PNGS { Error: ENOENT: no such file or directory, stat 'C:\Users\Jrial\Documents\Imaxes AFF\icons\png\57.png' at Object.fs.statSync (fs.js:948:11) at images.some.image (C:\Users\Jrial\AppData\Roaming\npm\node_modules\electron-icon-generator\node_modules\icon-gen\dist\lib\icon-generator.js:115:35) at Array.some () at Promise (C:\Users\Jrial\AppData\Roaming\npm\node_modules\electron-icon-generator\node_modules\icon-gen\dist\lib\icon-generator.js:114:14) at new Promise () at Function.fromPNG (C:\Users\Jrial\AppData\Roaming\npm\node_modules\electron-icon-generator\node_modules\icon-gen\dist\lib\icon-generator.js:99:12) at module.exports (C:\Users\Jrial\AppData\Roaming\npm\node_modules\electron-icon-generator\node_modules\icon-gen\dist\lib\index.js:43:38) at generateIcons (C:\Users\Jrial\AppData\Roaming\npm\node_modules\electron-icon-generator\index.js:190:9) at savePngs.then.values (C:\Users\Jrial\AppData\Roaming\npm\node_modules\electron-icon-generator\index.js:209:12) at errno: -4058, code: 'ENOENT', syscall: 'stat', path: 'C:\Users\Jrial\Documents\Imaxes AFF\icons\png\57.png' }

After this error, I only get a folder of icons/png (from 16 to 1024) but mac and win folders are empty

Thanks for this tool!!!

fjrial avatar Aug 31 '18 06:08 fjrial

ok, looking into the code and node_modules dependancies.. it's a problem with favicon-generator.js in icon-gen module.. it has two array like this

const PNG_FILE_INFOS = [{ name: 'favicon-32.png', size: 32 }, // Certain old but not too old Chrome versions mishandle ico { name: 'favicon-57.png', size: 57 }, // Standard iOS home screen (iPod Touch, iPhone first generation to 3G) { name: 'favicon-72.png', size: 72 }, // iPad home screen icon { name: 'favicon-96.png', size: 96 }, // GoogleTV icon { name: 'favicon-120.png', size: 120 }, // iPhone retina touch icon (Change for iOS 7: up = require(114x114) { name: 'favicon-128.png', size: 128 }, // Chrome Web Store icon { name: 'favicon-144.png', size: 144 }, // IE10 Metro tile for pinned site { name: 'favicon-152.png', size: 152 }, // iPad retina touch icon (Change for iOS 7: up = require(144x144) { name: 'favicon-195.png', size: 195 }, // Opera Speed Dial icon { name: 'favicon-228.png', size: 228 // Opera Coast icon }];

and

const REQUIRED_PNG_IMAGE_SIZES = [32, 57, 72, 96, 120, 128, 144, 152, 195, 228];

A lot of these size images are not generated in the icons/png folder.. so I delete them in these array definitions.. and everything went fine.

A solution would be to create the png images also with these sizes.

fjrial avatar Aug 31 '18 07:08 fjrial