Sha256: b56ffc02cebdd8f1d59962bb9d65c8100aa12f01cdaf11d756d381d2e9d67384

Contents?: true

Size: 1.04 KB

Versions: 18

Compression:

Stored size: 1.04 KB

Contents

require 'spec_helper'

describe FormatParser::DPXParser do
  describe 'with Depix example files' do
    Dir.glob(fixtures_dir + '/dpx/*.*').each do |dpx_path|
      it "is able to parse #{File.basename(dpx_path)}" do
        parsed = subject.call(File.open(dpx_path, 'rb'))

        expect(parsed).not_to be_nil
        expect(parsed.nature).to eq(:image)
        expect(parsed.format).to eq(:dpx)

        # If we have an error in the struct offsets these values are likely to become
        # the maximum value of a 4-byte uint, which is way higher
        expect(parsed.width_px).to be_kind_of(Integer)
        expect(parsed.width_px).to be_between(0, 2048)
        expect(parsed.height_px).to be_kind_of(Integer)
        expect(parsed.height_px).to be_between(0, 4000)
      end
    end

    it 'correctly reads pixel dimensions' do
      fi = File.open(fixtures_dir + '/dpx/026_FROM_HERO_TAPE_5-3-1_MOV.0029.dpx', 'rb')
      parsed = subject.call(fi)
      expect(parsed.width_px).to eq(1920)
      expect(parsed.height_px).to eq(1080)
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
format_parser-0.10.0 spec/parsers/dpx_parser_spec.rb
format_parser-0.9.4 spec/parsers/dpx_parser_spec.rb
format_parser-0.9.3 spec/parsers/dpx_parser_spec.rb
format_parser-0.9.0 spec/parsers/dpx_parser_spec.rb
format_parser-0.8.0 spec/parsers/dpx_parser_spec.rb
format_parser-0.7.0 spec/parsers/dpx_parser_spec.rb
format_parser-0.6.0 spec/parsers/dpx_parser_spec.rb
format_parser-0.5.2 spec/parsers/dpx_parser_spec.rb
format_parser-0.5.1 spec/parsers/dpx_parser_spec.rb
format_parser-0.5.0 spec/parsers/dpx_parser_spec.rb
format_parser-0.4.0 spec/parsers/dpx_parser_spec.rb
format_parser-0.3.5 spec/parsers/dpx_parser_spec.rb
format_parser-0.3.4 spec/parsers/dpx_parser_spec.rb
format_parser-0.3.3 spec/parsers/dpx_parser_spec.rb
format_parser-0.3.2 spec/parsers/dpx_parser_spec.rb
format_parser-0.3.1 spec/parsers/dpx_parser_spec.rb
format_parser-0.3.0 spec/parsers/dpx_parser_spec.rb
format_parser-0.2.0 spec/parsers/dpx_parser_spec.rb