Skip to content

Commit

Permalink
Fix binary problems with JAR files.
Browse files Browse the repository at this point in the history
  • Loading branch information
bgaillard committed Aug 9, 2016
1 parent 0651127 commit 2258cf3
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,8 @@
/phpunit.xml export-ignore

* text eol=lf

# Denote all files that are truly binary and should not be modified.
*.gif binary
*.png binary
*.jpg binary
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ install:
- composer install

script:
- ls /home/travis/build/gomoob/php-metadata-extractor/src/main/resources/jars/metadata-extractor-2.9.1.jar
- ls /home/travis/build/gomoob/php-metadata-extractor/src/main/resources/jars
- java -classpath '/home/travis/build/gomoob/php-metadata-extractor/src/main/resources/jars/metadata-extractor-2.9.1.jar' com.drew.imaging.ImageMetadataReader '/home/travis/build/gomoob/php-metadata-extractor/src/test/resources/elephant.jpg'
- java -classpath /home/travis/build/gomoob/php-metadata-extractor/src/main/resources/jars/metadata-extractor-2.9.1.jar com.drew.imaging.ImageMetadataReader '/home/travis/build/gomoob/php-metadata-extractor/src/test/resources/elephant.jpg'
- grunt
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ public static function readMetadata($file)

// Otherwise create and configure a new directory
if (!$directory) {
var_dump($directoryName);

// var_dump($directoryName);

$directory = static::createDirectoryWithName($directoryName);

Expand Down Expand Up @@ -182,7 +183,7 @@ private static function addTagToDirectory(Directory $directory, $tagLine)
break;
case 'Y Resolution':
$directory->setRational(
ExifIFD0Directory::TAG_X_RESOLUTION,
ExifIFD0Directory::TAG_Y_RESOLUTION,
new Rational(intval(static::parseDotsString($nameAndDescription[1])), 1)
);
break;
Expand Down
Binary file modified src/main/resources/jars/metadata-extractor-2.9.1.jar
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ public function testReadMetadata()
$this->assertSame(300, $rational->getNumerator());
$this->assertSame(1, $rational->getDenominator());

$rational = $directory->getRational(ExifIFD0Directory::TAG_Y_RESOLUTION);
$this->assertSame(300, $rational->getNumerator());
$this->assertSame(1, $rational->getDenominator());

// TODO: Continue testing
}
}

0 comments on commit 2258cf3

Please sign in to comment.