Created
September 4, 2008 18:40
-
-
Save thecocktail/8841 to your computer and use it in GitHub Desktop.
Nanoc plugin that flattens fireworks pngs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Sips Flatten Filter for nanoc 2.1.1 | |
# | |
# Uses the 'sips' command line tool in Mac OS X to flatten Fireworks images | |
# Quick hack, use at your own risk. Don't blame us if it destroys your carefully | |
# crafted images | |
module Nanoc::BinaryFilters | |
class SipsFlattenFilter < Nanoc::BinaryFilter | |
identifier :sips_flatten | |
def run(file) | |
# Get temporary file path | |
tmp_file = Tempfile.new("sips_filter") | |
flatten_format = @asset_rep.flatten_format || "png" | |
%x(sips -s format #{flatten_format} #{file.path} --out "#{tmp_file.path}">&/dev/null) | |
tmp_file | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment