Skip to content
This repository has been archived by the owner on Jun 23, 2023. It is now read-only.

Commit

Permalink
Merge 4b5ba7d into 1e66b9d
Browse files Browse the repository at this point in the history
  • Loading branch information
lsolesen committed Apr 21, 2016
2 parents 1e66b9d + 4b5ba7d commit 33b08b0
Show file tree
Hide file tree
Showing 14 changed files with 21 additions and 26 deletions.
2 changes: 1 addition & 1 deletion autoload.php
Expand Up @@ -33,4 +33,4 @@
include_once realpath($load);
}
}
});
});
1 change: 0 additions & 1 deletion composer.json
Expand Up @@ -25,7 +25,6 @@
"php": ">=5.0.0"
},
"require-dev" : {
"php": ">=5.5.0",
"ext-gd": "*",
"phpunit/phpunit": "4.4.*",
"squizlabs/php_codesniffer": "2.*",
Expand Down
1 change: 0 additions & 1 deletion examples/gps.php
Expand Up @@ -36,7 +36,6 @@
*/
require_once '../autoload.php';

use lsolesen\pel\PelDataWindow;
use lsolesen\pel\PelJpeg;
use lsolesen\pel\PelTiff;

Expand Down
2 changes: 0 additions & 2 deletions examples/resize.php
Expand Up @@ -38,9 +38,7 @@ function println($args)
/* Load the required PEL files for handling JPEG images. */
require_once '../autoload.php';

use lsolesen\pel\PelDataWindow;
use lsolesen\pel\PelJpeg;
use lsolesen\pel\PelTiff;

/*
* Store the name of the script in $prog and remove this first part of
Expand Down
2 changes: 1 addition & 1 deletion makepackagexml.php
Expand Up @@ -78,7 +78,7 @@

$pfm->generateContents();

if (isset($_GET['make']) || (isset($_SERVER['argv']) && @$_SERVER['argv'][1] == 'make')) {
if (isset($_GET['make']) || (isset($_SERVER['argv']) && $_SERVER['argv'][1] == 'make')) {
if ($pfm->writePackageFile()) {
exit('package created');
}
Expand Down
2 changes: 0 additions & 2 deletions src/PelEntryTime.php
Expand Up @@ -206,8 +206,6 @@ public function getValue($type = self::UNIX_TIMESTAMP)
*/
public function setValue($timestamp, $type = self::UNIX_TIMESTAMP)
{
// if (empty($timestamp))
// debug_print_backtrace();
switch ($type) {
case self::UNIX_TIMESTAMP:
$this->day_count = $this->convertUnixToJd($timestamp);
Expand Down
10 changes: 5 additions & 5 deletions src/PelIfd.php
Expand Up @@ -965,7 +965,7 @@ public function getIterator()
*/
public function getThumbnailData()
{
if ($this->thumb_data != null) {
if ($this->thumb_data !== null) {
return $this->thumb_data->getBytes();
} else {
return '';
Expand Down Expand Up @@ -1002,7 +1002,7 @@ public function getNextIfd()
*/
public function isLastIfd()
{
return $this->next == null;
return $this->next === null;
}

/**
Expand Down Expand Up @@ -1074,7 +1074,7 @@ public function getBytes($offset, $order)
Pel::debug('Bytes from IDF will start at offset %d within Exif data', $offset);

$n = count($this->entries) + count($this->sub);
if ($this->thumb_data != null) {
if ($this->thumb_data !== null) {
/*
* We need two extra entries for the thumbnail offset and
* length.
Expand Down Expand Up @@ -1119,7 +1119,7 @@ public function getBytes($offset, $order)
}
}

if ($this->thumb_data != null) {
if ($this->thumb_data !== null) {
Pel::debug('Appending %d bytes of thumbnail data at %d', $this->thumb_data->getSize(), $end);
// TODO: make PelEntry a class that can be constructed with
// arguments corresponding to the newt four lines.
Expand Down Expand Up @@ -1199,7 +1199,7 @@ public function __toString()
foreach ($this->sub as $type => $ifd) {
$str .= $ifd->__toString();
}
if ($this->next != null) {
if ($this->next !== null) {
$str .= $this->next->__toString();
}
return $str;
Expand Down
4 changes: 2 additions & 2 deletions src/PelTiff.php
Expand Up @@ -222,7 +222,7 @@ public function getBytes($order = PelConvert::LITTLE_ENDIAN)
/* TIFF magic number --- fixed value. */
$bytes .= PelConvert::shortToBytes(self::TIFF_HEADER, $order);

if ($this->ifd != null) {
if ($this->ifd !== null) {
/*
* IFD 0 offset. We will always start IDF 0 at an offset of 8
* bytes (2 bytes for byte order, another 2 bytes for the TIFF
Expand Down Expand Up @@ -254,7 +254,7 @@ public function getBytes($order = PelConvert::LITTLE_ENDIAN)
public function __toString()
{
$str = Pel::fmt("Dumping TIFF data...\n");
if ($this->ifd != null) {
if ($this->ifd !== null) {
$str .= $this->ifd->__toString();
}

Expand Down
2 changes: 1 addition & 1 deletion test/Bug1730993Test.php
Expand Up @@ -39,7 +39,7 @@ function testThisDoesNotWorkAsExpected()
require_once 'PelJpeg.php';
$jpeg = new PelJpeg($tmpfile); // the error occurs here
$exif = $jpeg->getExif();
if ($exif != null) {
if ($exif !== null) {
$jpeg1 = new PelJpeg($bigfile);
$jpeg1->setExif($exif);
file_put_contents($bigfile, $jpeg1->getBytes());
Expand Down
6 changes: 2 additions & 4 deletions test/Bug3017880Test.php
Expand Up @@ -24,7 +24,6 @@
*/

use lsolesen\pel\PelJpeg;
use lsolesen\pel\PelEntryTime;
use lsolesen\pel\PelExif;
use lsolesen\pel\PelTiff;
use lsolesen\pel\PelIfd;
Expand Down Expand Up @@ -55,15 +54,15 @@ function testThisDoesNotWorkAsExpected()

$tiff = $exif->getTiff();
$ifd0 = $tiff->getIfd();
if ($ifd0 == null) {
if ($ifd0 === null) {
$ifd0 = new PelIfd(PelIfd::IFD0);
$tiff->setIfd($ifd0);
}

$software_name = 'Example V2';
$software = $ifd0->getEntry(PelTag::SOFTWARE);

if ($software == null) {
if ($software === null) {
$software = new PelEntryAscii(PelTag::SOFTWARE, $software_name);
$ifd0->addEntry($software);
$resave_file = 1;
Expand All @@ -74,7 +73,6 @@ function testThisDoesNotWorkAsExpected()

if ($resave_file == 1 && ! file_put_contents($filename, $jpeg->getBytes())) {
// if it was okay to resave the file, but it did not save correctly
$success = 0;
}
} catch (Exception $e) {
$this->fail('Test should not throw an exception');
Expand Down
8 changes: 6 additions & 2 deletions test/ConvertTest.php
Expand Up @@ -71,7 +71,9 @@ function testLongBig()
function testSLongLittle()
{
// TODO: Does not work on 64bit systems!
return;
$this->markTestIncomplete(
'Does not work on 64bit systems!'
);
$o = PelConvert::LITTLE_ENDIAN;

/*
Expand All @@ -98,7 +100,9 @@ function testSLongLittle()
function testSLongBig()
{
// TODO: Does not work on 64bit systems
return;
$this->markTestIncomplete(
'Does not work on 64bit systems!'
);

$o = PelConvert::BIG_ENDIAN;

Expand Down
4 changes: 2 additions & 2 deletions test/GH16Test.php
Expand Up @@ -55,7 +55,7 @@ function testThisDoesNotWorkAsExpected()
$jpeg->load($data);
$exif = $jpeg->getExif();

if (null == $exif) {
if (null === $exif) {
$exif = new PelExif();
$jpeg->setExif($exif);
$tiff = new PelTiff();
Expand All @@ -65,7 +65,7 @@ function testThisDoesNotWorkAsExpected()
$tiff = $exif->getTiff();

$ifd0 = $tiff->getIfd();
if (null == $ifd0) {
if (null === $ifd0) {
$ifd0 = new PelIfd(PelIfd::IFD0);
$tiff->setIfd($ifd0);
}
Expand Down
2 changes: 1 addition & 1 deletion test/GH21Test.php
Expand Up @@ -70,7 +70,7 @@ function testThisDoesNotWorkAsExpected()

$exif = $input_jpeg->getExif();

if ($exif != null) {
if ($exif !== null) {
$output_jpeg->setExif($exif);
}

Expand Down
1 change: 0 additions & 1 deletion test/NumberTest.php
Expand Up @@ -32,7 +32,6 @@
use \lsolesen\pel\PelEntrySLong;
use \lsolesen\pel\PelEntryRational;
use \lsolesen\pel\PelEntrySRational;
use \lsolesen\pel\PelEntryUndefined;
use \lsolesen\pel\PelOverflowException;

abstract class NumberTest extends \PHPUnit_Framework_TestCase
Expand Down

0 comments on commit 33b08b0

Please sign in to comment.