Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

removing useless files

  • Loading branch information...
commit cdde107e676570dba9752496e87a93cdffec0261 1 parent 4794670
@aberant authored
Showing with 0 additions and 78 deletions.
  1. +0 −61 bin/png_info
  2. +0 −17 examples/filter_util.rb
View
61 bin/png_info
@@ -1,61 +0,0 @@
-#!/usr/bin/env ruby
-require File.join( File.dirname( __FILE__ ), '..', 'lib', 'css-spriter' )
-
-module PNG
- class Parser
- def go!( file )
- check_header( file )
-
- while(! file.eof?) do
- parse_chunk(file)
- end
- end
-
- private
- def check_header( file )
- header = file.read(8)
- raise "Invalid PNG file header" unless ( header == FileHeader.new.encode)
- end
-
- def parse_chunk(f)
- len = f.read(4).unpack("N")
- type = f.read(4)
- data = f.read(len[0])
- crc = f.read(4)
- handle(type, len, data )
- end
-
- def handle( type, len, data )
- case type
- when "IHDR"
- attrs = data.unpack("N2C5")
- puts "PNG width: #{attrs[0]}"
- puts "PNG height: #{attrs[1]}"
- puts "PNG depth: #{attrs[2]}"
- puts "PNG color type: #{attrs[3]}"
- puts "PNG compression method: #{attrs[4]}"
- puts "PNG filter method: #{attrs[5]}"
- puts "PNG interlace method: #{attrs[6]}"
- end
-
- puts "PNG block #{type}"
- puts "length: #{len}"
- end
- end
-
-
- class Info
- def self.open( file_name )
- @parser = Parser.new
-
- name = File.basename( file_name, ".png" )
-
- File.open(file_name, "r") do |f|
- @parser.go!( f )
- end
- end
- end
-end
-
-
-PNG::Info.open( ARGV[0] )
View
17 examples/filter_util.rb
@@ -1,17 +0,0 @@
-# horrible place for this. just a sanity check for filtering
-
-require File.join( File.dirname( __FILE__ ), '..', 'lib', 'css-spriter' )
-
-image = PNG::Image.open( "sprites/many_sized_cats/darth_cat.png")
-
-5.times do |i|
- puts i
- image.write("bob-filter-#{i}.png", :filter_type => i)
-end
-
-5.times do |i|
- filename = "bob-filter-#{i}.png"
- puts "filter #{i}: #{File.size( filename )}"
- File.delete( filename )
-end
-
Please sign in to comment.
Something went wrong with that request. Please try again.