Skip to content

Commit

Permalink
Fix "Cannot redeclare img\util\ImageInfo::hashCode()"
Browse files Browse the repository at this point in the history
  • Loading branch information
thekid committed Oct 1, 2022
1 parent 6471e4b commit 371233e
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 32 deletions.
4 changes: 4 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ Imaging APIs for the XP Framework ChangeLog

## ?.?.? / ????-??-??

## 10.1.1 / 2022-10-01

* Fixed "Cannot redeclare img\util\ImageInfo::hashCode()" - @thekid

## 10.1.0 / 2022-09-10

* Merged PR #1: Add WebP support - @thekid
Expand Down
7 changes: 3 additions & 4 deletions src/main/php/img/util/ExifData.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@
/**
* Reads the EXIF headers from JPEG or TIFF
*
* @test xp://net.xp_framework.unittest.img.ExifDataTest
* @see php://exif_read_data
* @ext exif
* @purpose Utility
* @test net.xp_framework.unittest.img.ExifDataTest
* @see php://exif_read_data
* @ext exif
*/
class ExifData implements Value {
public static $EMPTY= null;
Expand Down
19 changes: 3 additions & 16 deletions src/main/php/img/util/ImageInfo.class.php
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<?php namespace img\util;

use img\ImagingException;
use lang\Value;
use util\Objects;

/**
* Image information
*
* @see php://getimagesize
* @purpose Utility
* @see php://getimagesize
*/
class ImageInfo implements \lang\Value {
class ImageInfo implements Value {
public
$width = 0,
$height = 0,
Expand Down Expand Up @@ -45,19 +45,6 @@ public static function fromFile($file) {
return $i;
}

/** @return string */
public function hashCode() {
return Objects::hashOf([
$this->width,
$this->height,
$this->type,
$this->mime,
$this->bits,
$this->channels,
$this->segments
]);
}

/**
* Creates a string representation of this object
*
Expand Down
24 changes: 12 additions & 12 deletions src/main/php/img/util/IptcData.class.php
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
<?php namespace img\util;

use img\ImagingException;
use lang\{ElementNotFoundException, FormatException};
use lang\{ElementNotFoundException, FormatException, Value};
use util\{Date, Objects};

/**
* Reads the IPTC headers from Photoshop-files JPEGs or TIFFs
*
* <code>
* uses('img.util.IptcData', 'io.File');
* ```php
* use img\util\IptcData;
* use io\File;
*
* // Use empty iptc data as default value when no iptc data is found
* echo IptcData::fromFile(new File($filename), IptcData::$EMPTY)->toString();
* </code>
* // Use empty iptc data as default value when no iptc data is found
* echo IptcData::fromFile(new File($filename), IptcData::$EMPTY)->toString();
* ```
*
* @test xp://net.xp_framework.unittest.img.IptcDataTest
* @purpose Utility
* @see php://iptcparse
* @see http://photothumb.com/IPTCExt/
* @see http://www.controlledvocabulary.com/pdf/IPTC_mapped_fields.pdf
* @test net.xp_framework.unittest.img.IptcDataTest
* @see php://iptcparse
* @see http://photothumb.com/IPTCExt/
* @see http://www.controlledvocabulary.com/pdf/IPTC_mapped_fields.pdf
*/
class IptcData implements \lang\Value {
class IptcData implements Value {
public static $EMPTY= null;

public
Expand Down

0 comments on commit 371233e

Please sign in to comment.