imageparser 0.0.6 → 0.0.7

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/legacyparser.rb +9 -4
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7a3b3f700c25404d3072c90302d22123d6cd35cb
4
- data.tar.gz: d732b5677cc72c56b1aee514356cbc9701240201
3
+ metadata.gz: d97de53e2293b5174afb5712253ff03742c8c180
4
+ data.tar.gz: 33fd409dcaceb37ef6804f3c1fd5216cd6d7d277
5
5
  SHA512:
6
- metadata.gz: fa0d21ab5adedb8175829110456859a6d3aa825804ecfa67a4763e751f07f8cfca7eb4283f1b9b8420ed7750379d1c240707394c5b424534d52fd7a2233a9efe
7
- data.tar.gz: c0809456ea105744d6446df5b65a8003158f76a9e381ffe58d8b233945db5e6864a33be8b567bc411433d00525396e3ce53d50e654fb8f78f90b9c91a649cbd0
6
+ metadata.gz: 841ac3d90a138142a70b533725df309cb6054966bb49f718c38a15804a5fc0e9666739957501e6b6594a3c3bcdb4973e8378832123856fa05e7688633a363618
7
+ data.tar.gz: 4d73a3ec9b221c3d6b627668b31ae3fccea6d3c7c8c1a9844be521a8b9b87dc918d91b2014a8002f14b82bf1688082e3feea2ef11699833c62206e662c60a2a8
@@ -1,10 +1,12 @@
1
+ require_relative 'imageparser'
1
2
  # Legacy Image Parser
2
3
  #
3
4
  # Gives more abilities for image parsing than
4
5
  # the regular ImageParser.
5
- require_relative 'imageparser'
6
6
 
7
7
  class LegacyParser
8
+ # Accessors for an ImageParser and regular
9
+ # binary parsing.
8
10
  attr_accessor :img, :con
9
11
  def initialize(file=nil)
10
12
  @img = ImageParser.new(file) if file
@@ -29,8 +31,11 @@ class LegacyParser
29
31
  #
30
32
  # unfinished..
31
33
  def parse_bmp(info)
32
- # to do..
34
+ info[:fhType] = @con[0, 2] if @con[0, 2] == "BM"
35
+ info[:fhSize] = @con[2, 4].unpack("l<")[0]
36
+ info[:fhReserved] = @con[5, 2].unpack("C*")[0]
37
+ info[:fhReserved1] = @con[5, 2].unpack("C*")[1]
38
+ info[:fhOffbits] = @con[7, 4].unpack("C*")
39
+ # -----------------------------------------------
33
40
  end
34
41
  end
35
-
36
-
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: imageparser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Himpon
@@ -41,5 +41,5 @@ rubyforge_project:
41
41
  rubygems_version: 2.4.6
42
42
  signing_key:
43
43
  specification_version: 4
44
- summary: Added BMP support(unfinished).
44
+ summary: Added partial BMP support.
45
45
  test_files: []