Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"description" : "Imaging APIs for the XP Framework",
"keywords": ["module", "xp"],
"require" : {
"xp-framework/core": "^12.0 | ^11.0 | ^10.0",
"xp-framework/core": "^12.11 | ^11.11",
"php" : ">=7.4.0",
"ext-gd" : "*"
},
Expand Down
4 changes: 2 additions & 2 deletions src/main/php/img/io/StreamReader.class.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php namespace img\io;

use img\ImagingException;
use io\{Channel, IOException};
use io\streams\{InputStream, Streams};
use io\{Channel, OperationFailed};
use lang\IllegalArgumentException;

/**
Expand Down Expand Up @@ -78,7 +78,7 @@ public function getResource() {
$f= $this->reader;
try {
return $f($this, $this->stream);
} catch (IOException $e) {
} catch (OperationFailed $e) {
throw new ImagingException($e->getMessage());
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/test/php/img/unittest/GifImageWriterTest.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use img\ImagingException;
use img\io\GifStreamWriter;
use io\IOException;
use io\OperationFailed;
use io\streams\{MemoryOutputStream, OutputStream};
use test\{Assert, Expect, Test};

Expand All @@ -12,7 +12,7 @@ class GifImageWriterTest extends AbstractImageWriterTest {
#[Test, Expect(ImagingException::class)]
public function write_error() {
$this->image->saveTo(new GifStreamWriter(new class() implements OutputStream {
public function write($arg) { throw new IOException('Could not write: Intentional exception'); }
public function write($arg) { throw new OperationFailed('Could not write: Intentional exception'); }
public function flush() { }
public function close() { }
}));
Expand Down
4 changes: 2 additions & 2 deletions src/test/php/img/unittest/ImageReaderTest.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use img\io\PngStreamReader;
use img\{Image, ImagingException};
use io\IOException;
use io\OperationFailed;
use io\streams\{InputStream, MemoryInputStream};
use test\{Expect, Test};

Expand All @@ -12,7 +12,7 @@ class ImageReaderTest {
#[Test, Expect(ImagingException::class)]
public function readError() {
Image::loadFrom(new PngStreamReader(new class() implements InputStream {
public function read($limit= 8192) { throw new IOException('Could not read: Intentional exception'); }
public function read($limit= 8192) { throw new OperationFailed('Could not read: Intentional exception'); }
public function available() { return 1; }
public function close() { }
}));
Expand Down
4 changes: 2 additions & 2 deletions src/test/php/img/unittest/JpegImageWriterTest.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use img\ImagingException;
use img\io\JpegStreamWriter;
use io\IOException;
use io\OperationFailed;
use io\streams\{MemoryOutputStream, OutputStream};
use test\{Assert, Expect, Test};

Expand All @@ -12,7 +12,7 @@ class JpegImageWriterTest extends AbstractImageWriterTest {
#[Test, Expect(ImagingException::class)]
public function write_error() {
$this->image->saveTo(new JpegStreamWriter(new class() implements OutputStream {
public function write($arg) { throw new IOException('Could not write: Intentional exception'); }
public function write($arg) { throw new OperationFailed('Could not write: Intentional exception'); }
public function flush() { }
public function close() { }
}));
Expand Down
4 changes: 2 additions & 2 deletions src/test/php/img/unittest/PngImageWriterTest.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use img\ImagingException;
use img\io\PngStreamWriter;
use io\IOException;
use io\OperationFailed;
use io\streams\{MemoryOutputStream, OutputStream};
use test\{Assert, Expect, Test};

Expand All @@ -15,7 +15,7 @@ protected function imageType() { return 'PNG'; }
#[Test, Expect(ImagingException::class)]
public function write_error() {
$this->image->saveTo(new PngStreamWriter(new class() implements OutputStream {
public function write($arg) { throw new IOException('Could not write: Intentional exception'); }
public function write($arg) { throw new OperationFailed('Could not write: Intentional exception'); }
public function flush() { }
public function close() { }
}));
Expand Down
4 changes: 2 additions & 2 deletions src/test/php/img/unittest/WebpImageWriterTest.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use img\ImagingException;
use img\io\WebpStreamWriter;
use io\IOException;
use io\OperationFailed;
use io\streams\{MemoryOutputStream, OutputStream};
use test\{Assert, Expect, Test};

Expand All @@ -12,7 +12,7 @@ class WebpImageWriterTest extends AbstractImageWriterTest {
#[Test, Expect(ImagingException::class)]
public function write_error() {
$this->image->saveTo(new WebpStreamWriter(new class() implements OutputStream {
public function write($arg) { throw new IOException('Could not write: Intentional exception'); }
public function write($arg) { throw new OperationFailed('Could not write: Intentional exception'); }
public function flush() { }
public function close() { }
}));
Expand Down
Loading