App-Icon-Template icon indicating copy to clipboard operation
App-Icon-Template copied to clipboard

Add support for OS X

Open ghost opened this issue 9 years ago • 5 comments

After cloning and updating resize.sh to point at the Inkscape binary on OS X I get the following:

16:56 App-Icon-Template master* ❯ ./resize.sh AppIconTemplate.svg
** (inkscape-bin:62458): WARNING **: Can't open file: AppIconTemplate.svg (doesn't exist)
** (inkscape-bin:62458): WARNING **: Can't open file: AppIconTemplate.svg (doesn't exist)

...

** (inkscape-bin:63852): WARNING **: Can't open file: AppIconTemplate.svg (doesn't exist)
** (inkscape-bin:63852): WARNING **: Can't open file: AppIconTemplate.svg (doesn't exist)
** (inkscape-bin:63852): WARNING **: Specified document AppIconTemplate.svg cannot be opened (does not exist or not a valid SVG file)
cp: AppIconTemplate-512.png: No such file or directory
cp: AppIconTemplate-1024.png: No such file or directory

If I update the command to the following it appears to run as expected, but doesn't output any files to my file system (also tried with SUDO just to be sure):

16:56 App-Icon-Template master* ❯ ./resize.sh ~/Developer/App-Icon-Template/AppIconTemplate.svg
Background RRGGBBAA: ffffff00
Area -0.0351562:-0.0324556:1024:1024.02 exported to 29 x 29 pixels (2.5487 dpi)
Bitmap saved as: AppIconTemplate-29.png
Background RRGGBBAA: ffffff00
Area -0.0351562:-0.0324556:1024:1024.02 exported to 58 x 58 pixels (5.0974 dpi)
Bitmap saved as: [email protected]

...

Background RRGGBBAA: ffffff00
Area -0.0351562:-0.0324556:1024:1024.02 exported to 512 x 512 pixels (44.9978 dpi)
Bitmap saved as: AppIconTemplate-512.png
Background RRGGBBAA: ffffff00
Area -0.0351562:-0.0324556:1024:1024.02 exported to 1024 x 1024 pixels (89.9956 dpi)
Bitmap saved as: AppIconTemplate-1024.png
cp: AppIconTemplate-512.png: No such file or directory
cp: AppIconTemplate-1024.png: No such file or directory

I'm using OS X Yosemite 10.10.3 and have no problems using the Inkscape app with X11. But it'd be stellar if this script supported OS X.

ghost avatar Jun 01 '15 22:06 ghost

Was able to get this working on OS X Yosemite this morning using Docker with an Ubuntu installation. I wrote a tutorial on how to do it for those who run into the same problem. Closing this issue as it feels to be more of a OS X and Inkscape compatibility issue than anything related to this script.

ghost avatar Jun 03 '15 15:06 ghost

Reopening for better visibility on the want.

ghost avatar Jul 17 '15 21:07 ghost

It sounds like the folder it is working in is not the folder it is called from. Honestly, I don't know how bash does this in OSX, but I think that is where to look. Do a pwd in your local copy of the script.

It could also have to do with how Inkscape accesses the file system on OSX. You can extract a single command and see what happens.

inkscape -z -D -e "out-29.png" -f AppIconTemplate.svg -w 29 -h 29

Let me know what you find.

theherk avatar Jul 18 '15 01:07 theherk

modifying the script from $INK -z -D -e "$BASE-29.png" -f $SVG -w 29 -h 29 to $INK -z -D -e "$(pwd)/$BASE-29.png" -f $SVG -w 29 -h 29 seemed to work for me. You still have to run it like ./resize.sh ~/Developer/App-Icon-Template/AppIconTemplate.svg though

yoheioka avatar Mar 16 '16 04:03 yoheioka

See also update from Nov 11 here: http://habd.as/automating-ios-app-icon-creation/

ghost avatar Mar 16 '16 04:03 ghost