Skip to content
This repository was archived by the owner on Jun 23, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Cleanup of tests
  • Loading branch information
mondrake committed Nov 18, 2017
commit cbed3e86338cc0304e364102def1a387e6857b9d
6 changes: 3 additions & 3 deletions src/PelIfd.php
Original file line number Diff line number Diff line change
Expand Up @@ -344,11 +344,11 @@ public function load(PelDataWindow $d, $offset)
}

if ($starting_offset != $o) {
$this->sub[$type] = new PelIfd($type);
$ifd = new PelIfd($type);
try {
$this->sub[$type]->load($d, $o);
$ifd->load($d, $o);
$this->sub[$type] = $ifd;
} catch (PelDataWindowOffsetException $e) {
unset($this->sub[$type]);
Pel::maybeThrow(new PelIfdException($e->getMessage()));
}
} else {
Expand Down
18 changes: 10 additions & 8 deletions test/Bug1730993Test.php → test/BrokenImagesTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

/**
* PEL: PHP Exif Library.
* A library with support for reading and
Expand All @@ -26,17 +25,20 @@
use lsolesen\pel\PelJpeg;
use PHPUnit\Framework\TestCase;

class Bug1730993Test extends TestCase
class BrokenImagesTest extends TestCase
{
function testWindowWindowExceptionIsCaught()
public function testWindowWindowExceptionIsCaught()
{
new PelJpeg(dirname(__FILE__) . '/broken_images/gh-10-a.jpg');
}

public function testWindowOffsetExceptionIsCaught()
{
$tmpfile = dirname(__FILE__) . '/images/bug1730993_tmp.jpg';
$jpeg = new PelJpeg($tmpfile);
new PelJpeg(dirname(__FILE__) . '/broken_images/gh-10-b.jpg');
}

function testWindowOffsetExceptionIsCaught()
public function testParsingNotFailingOnRecursingIfd()
{
$tmpfile = dirname(__FILE__) . '/images/27303092-d9d72838-54f6-11e7-943c-78933f9c9fbe.jpg';
$jpeg = new PelJpeg($tmpfile);
new PelJpeg(dirname(__FILE__) . '/broken_images/gh-11.jpg');
}
}
35 changes: 0 additions & 35 deletions test/Bug2979466Test.php

This file was deleted.