Jump to content

  • Log in with Facebook Log in with Twitter Log In with Google      Sign In   
  • Create Account

icns conversion with sips


  • Please log in to reply
5 replies to this topic

#1 devilhunter

devilhunter

    just dancing to the beat

  • Administrators
  • 3,051 posts
  • LocationSpace/Virgo Supercluster/Milky Way/Orion Arm/Earth
  • Graphics Card:NVIDIA 9800 GTX+
  • Operating System:Mac OS X 10.6 (Snow Leopard)
Author

Posted 08 February 2011 - 10:28 PM

sips is a image tool behind Preview.app that lets you convert pictures to icons. (icns)

also works from the command-line-fu:

sips -s format icns /path/to/the/picture.png --out /path/to/the/picture.icns
This makes .icns files out of every* picture, jpeg, png, tif etc...

* as long as it's either 128x128, 256x256 or 512x512 pixel.

Preview.app can't convert pictures to icons that don't have exactly one of these three sizes, converting a 400x400 icon will fail for example.

How about implementing this into the Wineskin icon setting?
Code checks either if:
- normal .icns like now and copy into Wrapper (currently only this works in WS)
- if it's a picture, let sips work with the pic to make a .icns file, then import into Wrapper
- if it's picture and sips fails because pic hasn't got 128x128, 256x256 or 512x512, then no .icns file will be created and Wineskin will notice no .icns file and say: picture has not the right dimensions (the 3 above), can't make .icns file from it.

sips will create an invisible temp file for the icon in the same dir, if the conversion suceeds, the inv. temp file will be moved to the icon name, if it fails, the inv. temp file will still be there however. remove via rm or whatever if the conversion fails.


works both in Leopard and Snow.
Weird thing is, Leopard Preview.app doesn't have the .icns export functionality, only the one in Snow has. Seems like Leopard Preview.app doesn't take advantage of sips...

#2 doh123

doh123

    Wineskin Developer

  • Members
  • 4,024 posts
  • LocationOver here
  • Graphics Card:Geforce GT 650M, Intel HD 4000, Radeon 6750, Intel HD 3000, Geforce 320m (in 3 machines)
  • Operating System:Mac OS X 10.8 (Mountain Lion)
  • I like to play:RPG and Strategy

Posted 09 February 2011 - 12:34 AM

the size issue can be a pain... I'm not sure I could do this for any type of automatic conversion... pulling out .ico files won't be any of those sizes.  This idea is still on my list of things to do, but just supporting grabbing non .icns files locally isn't a real high priority, I'd rather have it create icons from the chosen .exe.

Thanks for the info though!

#3 devilhunter

devilhunter

    just dancing to the beat

  • Administrators
  • 3,051 posts
  • LocationSpace/Virgo Supercluster/Milky Way/Orion Arm/Earth
  • Graphics Card:NVIDIA 9800 GTX+
  • Operating System:Mac OS X 10.6 (Snow Leopard)
Author

Posted 09 February 2011 - 09:32 PM

There is a lot of garbage info in exe files, often there are dozens of .ico files inside an exe.
Automatically grabbing the right one may be very hard to do, and there would be some limited success even if you manage to grab the largest .icon file by file size.

Often .icon files are used for ingame buttons or clickable objects in applications.

#4 doh123

doh123

    Wineskin Developer

  • Members
  • 4,024 posts
  • LocationOver here
  • Graphics Card:Geforce GT 650M, Intel HD 4000, Radeon 6750, Intel HD 3000, Geforce 320m (in 3 machines)
  • Operating System:Mac OS X 10.8 (Mountain Lion)
  • I like to play:RPG and Strategy

Posted 10 February 2011 - 04:21 AM

devilhunter said:

There is a lot of garbage info in exe files, often there are dozens of .ico files inside an exe.
Automatically grabbing the right one may be very hard to do, and there would be some limited success even if you manage to grab the largest .icon file by file size.

Often .icon files are used for ingame buttons or clickable objects in applications.
crossover usually pulls out the right one...

but still, Windows icons are usually so ugly and small, its better to just open up Gimp and take a screen shot or something and make your own.

#5 Drakulix

Drakulix

    A LIVING THING

  • Members
  • 1,880 posts
  • LocationGermany
  • Graphics Card:nVidia GeForce 650M 1GB
  • Operating System:Mac OS X 10.6 (Snow Leopard)
  • I like to play:FPS, Action, Minecraft, Skyrim, Strategy, rare Racing

Posted 10 February 2011 - 06:14 PM

Maybe then just add the option to select also png, jpg or even bmp files in the Settings app
and let wineskin automatically convert them? so user would not have to deal with it,
only with the resolution.

Posted Image
God save us everyone, Will we burn inside the fires of a thousand suns? - Linkin Park The Catalyst

Listen to their new Single Burn it Down for free!


#6 TommyGun

TommyGun

    Regular Member

  • Members
  • Pip
  • 17 posts

Posted 10 February 2011 - 07:36 PM

I highly suggest you use "Icon Composer" instead. Comes with Apple Developer Tools (Xcode), you can fin it in you OS X disc as "optional installs".
If someone needs it i can upload for you but its freeware anyways.
Good luck! ;-)
transgame the world!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users