Skip to content

Commit

Permalink
Fix windows IC
Browse files Browse the repository at this point in the history
  • Loading branch information
romainneutron committed May 7, 2012
1 parent 08b4e16 commit 279a8e6
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
8 changes: 4 additions & 4 deletions lib/PHPExiftool/PreviewExtractor.php
Expand Up @@ -24,10 +24,10 @@ public function extract($pathfile, $outputDir)
throw new Exception\LogicException(sprintf('%s is not writable', $outputDir));
}

$command = self::getBinary() . " -if '\$jpgfromraw' -b -jpgfromraw "
. "-w " . realpath($outputDir) . "/JpgFromRaw%c.jpg -execute "
. "-if '\$previewimage' -b -previewimage "
. "-w " . realpath($outputDir) . "/PreviewImage%c.jpg "
$command = self::getBinary() . " -if \"\$jpgfromraw\" -b -jpgfromraw "
. "-w " . escapeshellarg(realpath($outputDir)) . "/JpgFromRaw%c.jpg -execute "
. "-if \"\$previewimage\" -b -previewimage "
. "-w " . escapeshellarg(realpath($outputDir)) . "/PreviewImage%c.jpg "
. "-common_args -q -m " . $pathfile;

try {
Expand Down
14 changes: 10 additions & 4 deletions tests/lib/PHPExiftool/ReaderTest.php
Expand Up @@ -9,6 +9,7 @@ class ReaderTest extends \PHPUnit_Framework_TestCase
*/
protected $object;
protected static $tmpDir;
protected $disableSymLinkTest = false;

public static function setUpBeforeClass()
{
Expand Down Expand Up @@ -41,7 +42,9 @@ public static function setUpBeforeClass()
file_put_contents($tmpDir2 . '/hello2.world', 'Hello');

if ( ! is_link(self::$tmpDir . '/symlink')) {
symlink($tmpDir2, self::$tmpDir . '/symlink');
if ( ! @symlink($tmpDir2, self::$tmpDir . '/symlink')) {
$this->disableSymLinkTest = true;
}
}

file_put_contents(self::$tmpDir . '/dir/newfile.txt', 'Hello');
Expand Down Expand Up @@ -126,8 +129,7 @@ public function testSort()

$results = array();

foreach($reader->all() as $entity)
{
foreach ($reader->all() as $entity) {
$results[] = $entity->getFile()->getFilename();
}

Expand All @@ -145,7 +147,7 @@ public function testFiles()

$splfile = $this->object->files(self::$tmpDir . '/hello.exiftool')->first()->getFile();

$this->assertEquals(realpath($file), $splfile->getPathname());
$this->assertEquals(realpath($file), realpath($splfile->getPathname()));
}

/**
Expand Down Expand Up @@ -318,6 +320,10 @@ public function testExtensionsMisUse()
*/
public function testFollowSymLinks()
{
if ($this->disableSymLinkTest) {
$this->markTestSkipped('This system does not support symlinks');
}

$reader = new Reader();
$reader->in(self::$tmpDir)
->followSymLinks();
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/PHPExiftool/WriterTest.php
Expand Up @@ -250,7 +250,7 @@ public function testAddMetadatasArg()
$writer->setModule(WriterTester::MODULE_MWG, false);
$this->assertNotContains(' -use MWG', $writer->addMetadatasArgTester($metadatas));

$this->assertContains(" -XMP-iptcExt:PersonInImage='Nicolas'", $writer->addMetadatasArgTester($metadatas));
$this->assertContains("/\ -XMP-iptcExt:PersonInImage=['\"]Nicolas['\"]", $writer->addMetadatasArgTester($metadatas));
}
}

Expand Down

0 comments on commit 279a8e6

Please sign in to comment.