File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,8 @@ def initialize(options={})
14
14
15
15
@image_path = File . expand_path ( File . join ( Rails . root , @config [ 'image_path' ] || 'public/images' ) )
16
16
@stylesheet_path = File . expand_path ( File . join ( Rails . root , @config [ 'stylesheet_path' ] || 'public/stylesheets' ) )
17
+
18
+ @format = @config [ 'format' ] ? @config [ 'format' ] . downcase ( ) : "png"
17
19
end
18
20
19
21
# execute the css sprite operation
@@ -100,6 +102,7 @@ def output_image(directory)
100
102
dest_image = composite_images ( dest_image , source_image , x , y )
101
103
end
102
104
dest_image . image_type = @config [ 'image_type' ] ? Magick . const_get ( @config [ 'image_type' ] ) : Magick ::PaletteMatteType
105
+ dest_image . format = @config [ 'format' ] || "PNG"
103
106
dest_image . write ( dest_image_path )
104
107
end
105
108
results
@@ -242,12 +245,12 @@ def all_images(directory)
242
245
243
246
# destination css sprite image path
244
247
def dest_image_path ( directory )
245
- directory + ".png"
248
+ directory + "." + @format
246
249
end
247
250
248
251
# destination css sprite image name
249
252
def dest_image_name ( directory )
250
- File . basename ( directory ) + ".png"
253
+ File . basename ( directory ) + "." + @format
251
254
end
252
255
253
256
# destination css file path
You can’t perform that action at this time.
0 commit comments