favicon_maker 0.2.2 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/favicon_maker/generator.rb +4 -1
- data/lib/favicon_maker/version.rb +1 -1
- metadata +1 -1
@@ -31,6 +31,8 @@ module FaviconMaker
|
|
31
31
|
colorspace_conv = ["RGB", "sRGB"]
|
32
32
|
colorspace_conv.reverse! if switch_colorspace
|
33
33
|
|
34
|
+
is_windows = (RbConfig::CONFIG['host_os'].match /mswin|mingw|cygwin/)
|
35
|
+
|
34
36
|
options = {
|
35
37
|
:versions => ICON_VERSIONS.keys,
|
36
38
|
:custom_versions => {},
|
@@ -71,8 +73,9 @@ module FaviconMaker
|
|
71
73
|
image.write output_file
|
72
74
|
when :ico
|
73
75
|
ico_cmd = "convert #{input_file} -colorspace #{colorspace_conv.first} "
|
76
|
+
escapes = "\\" unless is_windows
|
74
77
|
sizes.split(',').sort_by{|s| s.split('x')[0].to_i}.each do |size|
|
75
|
-
ico_cmd << "
|
78
|
+
ico_cmd << "#{escapes}( -clone 0 -colors 256 -resize #{size} #{escapes}) "
|
76
79
|
end
|
77
80
|
ico_cmd << "-delete 0 -colors 256 -colorspace #{colorspace_conv.last} #{File.join(output_path, version[:filename])}"
|
78
81
|
puts `#{ico_cmd}`
|