Skip to content

Commit

Permalink
Graphics for gotgithub v0.9.
Browse files Browse the repository at this point in the history
  • Loading branch information
jiangxin committed Dec 25, 2011
0 parents commit 88b1bf5
Show file tree
Hide file tree
Showing 181 changed files with 22,648 additions and 0 deletions.
48 changes: 48 additions & 0 deletions Rakefile
@@ -0,0 +1,48 @@
#!/usr/bin/ruby
# -*- coding: UTF-8 -*-

require 'fileutils'
require 'rubygems'

TARGET = "../images"
RESIZE = 600

if File.exist?('/Applications/Inkscape.app/Contents/Resources/bin/inkscape')
CMD_INKSCAPE='/Applications/Inkscape.app/Contents/Resources/bin/inkscape'
else
CMD_INKSCAPE='inkscape'
end
CMD_IMGMAGICK='convert'

desc "export images, default: rake convert[../images,600]"
task :convert, :target, :width do |t, args|
args.with_defaults(:target => TARGET, :width => RESIZE)
FileList["**/*.svg", "**/*.xcf", "**/*.jpg", "**/*.png", "**/*.gif"].each do |t|
[".svg", ".png", ".gif", ".xcf"].each do |prefer|
if File.exists?(t.sub(/\.[^.]+$/, prefer))
t = t.sub(/\.[^.]+$/, prefer)
break
end
end
if t =~ /\.svg/
f = args[:target] + '/' + t.sub(/\.[^.]+$/, '.png')
command = "#{CMD_INKSCAPE} -w #{args[:width]} -f #{t} -e #{f}"
elsif t =~ /\.xcf/
f = args[:target] + '/' + t.sub(/\.[^.]+$/, '.png')
command = "#{CMD_IMGMAGICK} -auto-level -flatten -resize '#{args[:width]}>' #{t} #{f}"
elsif t =~ /\.(jpg|png|gif)/
f = args[:target] + '/' + t
command = "#{CMD_IMGMAGICK} -auto-level -resize '#{args[:width]}>' #{t} #{f}"
end

unless uptodate?(f, t)
Dir.mkdir(File.dirname(f)) unless File.exists?(File.dirname(f))
sh command
File.utime(0, Time.now, f)
end
end
end

task :default do
system "rake -T"
end
Binary file added commercial-products/add-private-collaborators.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added commercial-products/available-plans.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added commercial-products/change-plan.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added commercial-products/github-enterprise-pricing.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added commercial-products/new-private-repository.xcf
Binary file not shown.
Binary file added commercial-products/org-change-plan.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added commercial-products/org-plan-status.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file added commercial-products/plan-status.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added commercial-products/private-repos-settings.xcf
Binary file not shown.
Binary file added explore-github/blog.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 88b1bf5

Please sign in to comment.