Skip to content

Commit 22d1eb8

Browse files
authored
fixing track tags fractions (#50)
* fixing exiftool-rb/exiftool_vendored.rb#37 issue where track tags were treated as fractions and were reduced to the lowest term in the output. * update readme badges
1 parent 073aa87 commit 22d1eb8

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
[![Gem Version](https://badge.fury.io/rb/exiftool.svg)](http://rubygems.org/gems/exiftool)
55
[![Gem Downloads](https://img.shields.io/gem/dt/exiftool.svg)](http://rubygems.org/gems/exiftool)
66
[![Gem Latest](https://img.shields.io/gem/dtv/exiftool.svg)](http://rubygems.org/gems/exiftool)
7-
[![Test Coverage](https://api.codeclimate.com/v1/badges/82cfb3b0d0d5e67499c7/test_coverage)](https://codeclimate.com/github/exiftool-rb/exiftool.rb/test_coverage)
8-
[![Maintainability](https://api.codeclimate.com/v1/badges/82cfb3b0d0d5e67499c7/maintainability)](https://codeclimate.com/github/exiftool-rb/exiftool.rb/maintainability)
7+
[![Code Coverage](https://qlty.sh/gh/exiftool-rb/projects/exiftool/coverage.svg)](https://qlty.sh/gh/exiftool-rb/projects/exiftool)
8+
[![Maintainability](https://qlty.sh/gh/exiftool-rb/projects/exiftool/maintainability.svg)](https://qlty.sh/gh/exiftool-rb/projects/exiftool)
99

1010
This gem is the simplest thing that could possibly work that
1111
reads the output of [exiftool](http://www.sno.phy.queensu.ca/~phil/exiftool)

lib/exiftool/field_parser.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def try_parse
8181
end
8282

8383
def fraction?
84-
raw_value.is_a?(String) && raw_value =~ FRACTION_RE
84+
raw_value.is_a?(String) && raw_value =~ FRACTION_RE && sym_key != :track
8585
end
8686

8787
def as_fraction

test/field_parser_test.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,4 +98,9 @@
9898
p = Exiftool::FieldParser.new('GPSLongitude', -122.475666666667)
9999
_(p.value).must_be_close_to(-122.475666666667)
100100
end
101+
102+
it 'parses track tags without reducing a fraction to lowest terms' do
103+
p = Exiftool::FieldParser.new('Track', '2/24')
104+
_(p.value).must_equal('2/24')
105+
end
101106
end

0 commit comments

Comments
 (0)