52 Commits

Author SHA1 Message Date
Rolf Howarth
5af87372aa
Use signed arithmetic when reading rectangle (#1131)
* Use signed arithmetic when reading rectangle

An operation such as DirectBitsRect can fail if the origin is -ve and we're applying a screen image ratio. See for example P564B1400.pict

* Fix copy/paste error in testNegativeOrigin()

---------

Co-authored-by: Harald Kuhr <harald.kuhr@gmail.com>
2025-05-30 16:14:23 +02:00
Rolf Howarth
defadbbbcd
Set 'frame' to correct image bounds (#1130)
Ensure the x,y offset for extended v2 pictures is respected by updating 'frame' to the correct bounding rectangle. As a result we
need to base output image directly on frame size rather than applying screen image ratio. See cow.pict.

Co-authored-by: Harald Kuhr <harald.kuhr@gmail.com>
2025-05-30 16:07:16 +02:00
Rolf Howarth
66363f8d09
Fix bounds issue in some v2 PICT files (#1129)
x2 and y2 were swapped over, resulting in an "invalid bounds" exception with -ve height on some nonV2Ext images,
see for example CatDV==2.0=1=.pict or Picture14.pict

Co-authored-by: Harald Kuhr <harald.kuhr@gmail.com>
2025-05-30 15:59:00 +02:00
Rolf Howarth
1bef35daba
Fix rendering of images with JPEG slices (#1124)
* Third attempt

* Add test file

* Only suppress lastQTRect if PackBitsRect immediately follows CompressedQuickTime opcode

* Only suppress lastQTRect if PackBitsRect immediately follows CompressedQuickTime opcode

* Add unit test that checks pixel values

* Add missing ImageIO import

* Fix formatting issues

---------

Co-authored-by: Harald Kuhr <harald.kuhr@gmail.com>
2025-05-30 15:51:06 +02:00
Harald Kuhr
0be5efc534 Add static import of Assumptions.assumeTrue 2025-05-30 15:50:02 +02:00
Rolf Howarth
35da57dfcf JUnit confusion about parameter order 2025-05-30 15:50:02 +02:00
Rolf Howarth
5d09bb664e Add assumption for TIFF reader being present as test will fail under jdk 1.8 2025-05-30 15:50:02 +02:00
Rolf Howarth
31117c7cea Add unit test for QuickTime mask issue 2025-05-30 15:50:02 +02:00
Rolf Howarth
ae0899fe76 Make sure maskSize bytes are skipped
If the CompressedQuickTime opcode has a mask then this wasn't processed properly. See for example P30946BDC.pict.
2025-05-30 15:50:02 +02:00
Rolf Howarth
f8b919ee58
Improve debug output (#1115)
Include hex opcode and file offset in debug output. Condense scan line messages in readOpDirectBits().

---------

Co-authored-by: Harald Kuhr <harald.kuhr@gmail.com>
2025-03-31 21:38:09 +02:00
Vyshak Puthusseri
543acce8a3
Upgrade to Junit5 (#1050)
* chore: Update to junit5 for servlet package

* chore: Update to junit5 for contrib package

* chore: Update to junit5 for common-image package

* chore: Update to junit5 for common-lang package

* chore: Update to junit5 for entire project files

* fix: test case for JPEGImageReaderTest failed for java 8 and 11

assertEquals was using old signature of junit4.

* Update common/common-io/src/test/java/com/twelvemonkeys/io/InputStreamAbstractTest.java

Co-authored-by: Harald Kuhr <harald.kuhr@gmail.com>

* Update common/common-io/src/test/java/com/twelvemonkeys/io/InputStreamAbstractTest.java

Co-authored-by: Harald Kuhr <harald.kuhr@gmail.com>

* Update imageio/imageio-bmp/src/test/java/com/twelvemonkeys/imageio/plugins/bmp/BMPImageReaderTest.java

Co-authored-by: Harald Kuhr <harald.kuhr@gmail.com>

* Update imageio/imageio-jpeg/src/test/java/com/twelvemonkeys/imageio/plugins/jpeg/JPEGImageReaderTest.java

Co-authored-by: Harald Kuhr <harald.kuhr@gmail.com>

* Update imageio/imageio-tiff/src/test/java/com/twelvemonkeys/imageio/plugins/tiff/TIFFImageMetadataTest.java

Co-authored-by: Harald Kuhr <harald.kuhr@gmail.com>

* Update imageio/imageio-tiff/src/test/java/com/twelvemonkeys/imageio/plugins/tiff/TIFFImageReaderTest.java

Co-authored-by: Harald Kuhr <harald.kuhr@gmail.com>

* Update imageio/imageio-tiff/src/test/java/com/twelvemonkeys/imageio/plugins/tiff/TIFFImageWriterTest.java

Co-authored-by: Harald Kuhr <harald.kuhr@gmail.com>

* Update imageio/imageio-core/src/test/java/com/twelvemonkeys/imageio/stream/BufferedChannelImageInputStreamTest.java

Co-authored-by: Harald Kuhr <harald.kuhr@gmail.com>

* Update imageio/imageio-core/src/test/java/com/twelvemonkeys/imageio/stream/BufferedChannelImageInputStreamTest.java

Co-authored-by: Harald Kuhr <harald.kuhr@gmail.com>

* refactor: few indentation changes and missed test case

- review change related to missing test annotation
- unwanted new lines inside test case
- duplicate assertions

* refactor: moved the lambda expression to method reference

* review: testNotNullWithParameterNull catch block was never executed.

Added the suggested change

* Apply suggestions from code review

chore: adjust suggested indentation

Co-authored-by: Harald Kuhr <harald.kuhr@gmail.com>

* Update imageio/imageio-core/src/test/java/com/twelvemonkeys/imageio/util/ImageReaderAbstractTest.java

Co-authored-by: Harald Kuhr <harald.kuhr@gmail.com>

* Update imageio/imageio-core/src/test/java/com/twelvemonkeys/imageio/util/ImageReaderAbstractTest.java

Co-authored-by: Harald Kuhr <harald.kuhr@gmail.com>

* Update imageio/imageio-core/src/test/java/com/twelvemonkeys/imageio/util/ImageWriterAbstractTest.java

Co-authored-by: Harald Kuhr <harald.kuhr@gmail.com>

* refactor: using assertTimeout doesnot kill the execution, even if the timeout happens.

It is better to use assertTimeoutPreemptively in cases, where we really want to kill the execution after timeout.
https://stackoverflow.com/questions/57116801/how-to-fail-a-test-after-a-timeout-is-exceeded-in-junit-5/57116959#57116959

---------

Co-authored-by: Harald Kuhr <harald.kuhr@gmail.com>
2024-11-12 10:13:15 +01:00
Harald Kuhr
7ed5663633 More tests of StandardImageMetadataSupport + minor API changes 2022-10-08 14:28:10 +02:00
Harald Kuhr
6458fcdcbd Major ImageMetadata refactor for more consistent standard metadata support.
Fixes a few related bugs as a bonus.
2022-10-08 13:43:26 +02:00
Harald Kuhr
00d6acd1bf [skip ci] Fixed some typos in comments. :-) 2022-04-26 19:25:52 +02:00
Harald Kuhr
967f8e6984 PICT metadata + PNTG support 2021-03-27 14:39:59 +01:00
Harald Kuhr
6c34fb211f ImageWriterAbstractTest refactorings. 2020-10-14 18:54:46 +02:00
Harald Kuhr
9fdbc3b1fc ImageReaderAbstractTest refactorings. 2020-10-14 17:06:35 +02:00
Harald Kuhr
86f8cf52a5 Comment fix 2020-08-07 16:36:08 +02:00
Harald Kuhr
bda6544a5f #556 PICTImageReaderSpi no longer claim to decode known formats 2020-08-07 16:31:29 +02:00
Koen De Groote
8ed5f06151 Changes suggested by Intellij in the category "Performance".
Updated.
2019-10-22 11:51:24 +02:00
Harald Kuhr
9e23413456 Fixed JavaDoc errors to enable Java 8 build. 2019-08-10 00:41:36 +02:00
Harald Kuhr
24c6682236 #311 Updated license headers to be the same as in the LICENSE.txt 2018-08-18 19:22:52 +02:00
Harald Kuhr
4afa934251 #431: Clean-up + added test 2018-08-18 13:12:54 +02:00
Seafra Forder
b43faf2fae Added an extra mark to match the reset call in the finally block 2018-07-16 14:21:57 +01:00
Harald Kuhr
b32a38bf02 #423: Minor clean-up 2018-05-22 20:47:04 +02:00
Harald Kuhr
ce7fb1cb94 #423: Finally fixed region parsing to Area (seems to work, but slow)!
Bonus: Implemented more transfer modes, better QT parsing/debug output.
2018-05-04 20:53:21 +02:00
Harald Kuhr
5c8b4e0edf #423 Fixed PICT offset issue. 2018-05-02 22:11:26 +02:00
Harald Kuhr
30582dc5e5 #423 Implemented opBitsRect for pixmap + opBitsRgn, opPackBitsRgn and opDirectBitsRgn, with some additional clea-up. 2018-05-01 12:22:00 +02:00
Harald Kuhr
2ea3acb2c6 #423 PICT IndexColor issue + always reading compressed for V1 bitmap. 2018-04-30 14:16:57 +02:00
Harald Kuhr
2078843086 #419 PICT rounding issue 2018-04-05 18:58:42 +02:00
Harald Kuhr
ab13084f44 #292 Preparing for Java 9 compatibility + general clean-up 2016-11-15 21:40:59 +01:00
Harald Kuhr
34eb084d24 #212 TIFF subsampling fix 2016-11-02 19:06:12 +01:00
Harald Kuhr
e9388e55ec #260 ProviderInfo fix 2016-06-02 11:24:57 +02:00
Harald Kuhr
3d68b61f72 #258 SPI typos 2016-06-01 10:12:29 +02:00
Harald Kuhr
e603ae260d TMI-64: Test case clean-up 2015-04-10 11:06:50 +02:00
Harald Kuhr
2c90bcc49c Added license to ProviderInfo classes + minor code clean up. 2015-04-07 11:23:14 +02:00
Harald Kuhr
b40d4dad17 New SPI info. 2015-03-20 15:35:26 +01:00
Harald Kuhr
4839c61f5c TMI-106, TMI-118: PICT JDK 8 fix + cleanup 2015-03-19 14:49:52 +01:00
Harald Kuhr
654f7e7a70 TMI-81: Support for 32 bit unsigned int color model.
Bonus: Cleaned up creation of ImageTypeSpecifiers and added tests.
2014-11-20 15:57:36 +01:00
Harald Kuhr
8c93be05a5 Better testing of source region reading. A few readers are failing for now, added @Ignore. 2014-09-26 15:59:19 +02:00
Harald Kuhr
38fa2189bc TMI-IIO: Removed some deprecation warnings. 2013-11-05 20:24:12 +01:00
Harald Kuhr
381e229575 Added a comment. 2012-06-21 16:57:57 +02:00
Harald Kuhr
0307237852 Better writer tests.
Fixed a bug in PICTWriter.
Minor changes in ImageReader/WriterBase classes.
2012-03-30 16:58:09 +02:00
Harald Kuhr
c19338b5b9 Test cases for writers + renamed reader test cases to follow naming convention. 2012-01-20 13:52:34 +01:00
Harald Kuhr
529377aa01 Fixed typo in doc. 2011-12-21 11:01:35 +01:00
Harald Kuhr
0c4fc454b9 Major test-case cleanup.
- Removed JMock dependency, tests rewritten to use Mockito for stub/mock
- All test should now be using JUnit annotation-style tests
- All modules should now depend on same JUnit version
- Rewrote a few tests to better utilize JUnit annotations
- Fixed a few broken tests
- Code style changes
2011-12-19 14:28:34 +01:00
Harald Kuhr
5857e27cf2 Charset issues. 2011-10-30 21:49:25 +01:00
Harald Kuhr
9cafe4d9a9 Major test overhaul, now uses JUnit 4 annotation style tests. 2011-10-18 20:16:32 +02:00
Harald Kuhr
dba1fa20da Removed non-UTF characters from source files. 2011-02-19 15:45:58 +01:00
Harald Kuhr
770f948e1a New code style. No functional changes. 2011-02-17 17:54:50 +01:00