1
0
mirror of https://github.com/Intervention/image.git synced 2025-09-03 10:53:01 +02:00

617 Commits

Author SHA1 Message Date
Oliver Vogel
55c64ef812 Add tests for NativeObjectDecoders 2024-05-09 09:15:44 +02:00
Oliver Vogel
193324ec88 Refactor line length calculation 2024-05-08 15:53:15 +02:00
Oliver Vogel
9a013b90fa Remove test
This test only fails with no longer supported GD lib version 2.1.
The docker container of the test environment comes unfortunately with
with version and I have not yet managed to install a more recent version.

Unfortunately, adding the PHPUnit attribute #RequiresPhpExtension
with version number does not work either.
2024-05-07 14:43:26 +02:00
Oliver Vogel
cf0291f9c1 Refactor InputHandler logic 2024-05-06 17:19:41 +02:00
Oliver Vogel
31fb728c14 Fix test 2024-05-05 13:18:03 +02:00
Oliver Vogel
72f455b2de Add tests to reproduce bug 2024-05-05 13:06:57 +02:00
Oliver Vogel
2e0cbf2408 Add tolerance to test 2024-05-05 11:49:04 +02:00
Oliver Vogel
41f2c96dc8 Refactor & fix bug in BaseTestCase::assertColor() 2024-05-05 11:48:13 +02:00
Oliver Vogel
ab403d98c6 Fix ignored opacity in Imagick's PlaceModifer for certain files. (#1346)
* Add tests to reproduce bug in PlaceModifier
* Fix bug in PlaceModifier
* Add tolerance parameter to BaseTestCase::assertColor()
2024-05-05 11:28:01 +02:00
Oliver Vogel
33cbb217a0 Filter out parameter that do not match target encoder (#1333)
Filter out parameters/options that are passed to a format-unspecific encoder like AutoEncoder::class or MediaTypeEncoder::class but are not available in the format specific target encoder.
2024-04-23 16:17:12 +02:00
Oliver Vogel
3ff1573b78 Add negative tests 2024-04-14 09:28:09 +02:00
Oliver Vogel
490b8ae5c4 Add option to encode interlaced PNG format 2024-04-14 09:24:26 +02:00
Oliver Vogel
8f6aabe8b9 Supported format detection (#1330)
* Implement data struture for format, media types & file extensions
* Refactor encoder resolving
* Extend type options in encoder methods
* Add DriverInterface::supports()
2024-04-13 18:42:48 +02:00
Oliver Vogel
5ee087e711 Refactor tests to use data providers 2024-04-13 16:01:54 +02:00
Oliver Vogel
2691d92ec5 Add ImageManager::driver() 2024-04-13 15:37:39 +02:00
Oliver Vogel
6e104b6594 Add ability to read Imagick or GDImage directly (#1329) 2024-04-10 15:17:36 +02:00
Oliver Vogel
d982359ab8 Add Encoder Options for progressive Jpeg & interlaced GIF format 2024-03-27 15:30:28 +01:00
Oliver Vogel
c261654599 Refactor encoder tests 2024-03-26 15:17:02 +01:00
Oliver Vogel
f035f7d516 Trim Modifier (#1322)
Co-authored-by: Sibin Grasic <sibin.grasic@oblak.studio>
2024-03-25 19:46:16 +01:00
Oliver Vogel
7f4ff15d51 Improve Driver Specializing Process (#1315)
Streamline driver specializing process of analyzers, modifers, encoders and decoders.
2024-03-23 08:08:41 +01:00
Oliver Vogel
88c24d178e Soften the test check for FontProcessorTest
As slightly different results can occur in different environments
with results of imageftbbox and roundings, a range is checked
instead of a fixed value.
2024-03-10 11:59:18 +01:00
Oliver Vogel
ed310770a5 Change font size in GD FontProcessorTest 2024-03-10 11:49:22 +01:00
Oliver Vogel
16df40cef9 Add tests for FontFactory stroke & wrap methods 2024-03-10 11:37:01 +01:00
Oliver Vogel
2b659a6863 Add test for Font::class stroke functions 2024-03-10 11:34:59 +01:00
Oliver Vogel
0d8df3801e Add tests for AbstractFontProcessor 2024-03-10 11:28:12 +01:00
Oliver Vogel
159fba5662 Add font processor tests 2024-03-10 11:06:35 +01:00
Oliver Vogel
03281ba995 Rename test functions 2024-03-10 10:13:45 +01:00
Oliver Vogel
67fde5f87e Restructure test folders & refactor test traits 2024-03-10 10:00:06 +01:00
Oliver Vogel
2e9f91c311 Centralize duplicate code 2024-03-08 16:22:59 +01:00
Oliver Vogel
a673763e14 Add text stroke outline effect
Adds the possibility to draw text with an outline stroke effect. The color and width of the outline can be specified.

During development, it was noticed that Imagick can handle the effect natively, but always draws it in the middle of the border. As there is currently no option to change this, the same trick was used that was already used for the implementation with the GD library.

This "compound" method first draws the outline several times with an offset before the actual text is placed over it.

However, this has the disadvantage that no transparent colors can be used if the stroke/outline effect is active as the would superimpose each other.

---------

Co-authored-by: MaximusLight <maximuslight7@gmail.com>
Co-authored-by: Oliver Vogel <oliver@olivervogel.com>
Co-authored-by: Amowogbaje Gideon <amowogbajegideon@gmail.com>
2024-03-02 12:37:29 +01:00
Oliver Vogel
17ff3337dd Implement ColorInterface::isTransparent() 2024-03-02 11:29:28 +01:00
Oliver Vogel
7eb16e1aa5 Add tests for importing colors into foreign color spaces 2024-03-02 11:17:12 +01:00
Oliver Vogel
f83f37e551 Fix merge conflicts 2024-02-29 15:16:14 +01:00
Oliver Vogel
dcc95b8299 PHPUnit 10 Migration (#1302)
* Bump PHPUnit dependencies

* Set return type of base TestCase methods

From the [PHPUnit 8 release notes][1], the `TestCase` methods below now declare a `void` return type:

- `setUpBeforeClass()`
- `setUp()`
- `assertPreConditions()`
- `assertPostConditions()`
- `tearDown()`
- `tearDownAfterClass()`
- `onNotSuccessfulTest()`

[1]: https://phpunit.de/announcements/phpunit-8.html

* Ignore PHPUnit cache folder

* Adopt PHP attributes in test classes

* Declare data providers as `static`

* Add return types to test methods

* Define test classes as `final`

* Migrate phpunit.xml to phpunit 10

* Correct phpunit attribute class name

* Rename base test class

* Restructure test folders

* Fix test image paths

* Only set rules for php files in .editorconfig

* Remove php unit flag in local test env

---------

Co-authored-by: Shift <shift@laravelshift.com>
2024-02-28 16:16:23 +01:00
Oliver Vogel
795b794ee8 Reduce the differences in text rendering with drivers
Reduce the differences in text rendering with drivers
2024-02-03 16:13:44 +01:00
Oliver Vogel
684f5e6eb6 Implement text wrapping 2024-02-03 14:51:17 +01:00
Oliver Vogel
ac7389fa96 Refactor font processing 2024-02-03 13:15:52 +01:00
Oliver Vogel
cfebf59334 Refactor group use 2024-01-31 16:36:14 +01:00
Oliver Vogel
875b2690cd Remove unused aliases 2024-01-30 19:46:47 +01:00
Oliver Vogel
1357b61993 Remove unused variables 2024-01-30 19:24:42 +01:00
Oliver Vogel
9015739860 Rename files to match namespaces & class names 2024-01-30 16:48:10 +01:00
Oliver Vogel
1aa8869e50 Refactor TextBlockTest 2024-01-28 16:58:58 +01:00
Oliver Vogel
8494cc91e3 Add test 2024-01-27 20:34:18 +01:00
Oliver Vogel
f4641342c3 Add tests 2024-01-27 20:19:25 +01:00
Oliver Vogel
2b99dd439c Add tests 2024-01-27 20:11:51 +01:00
Oliver Vogel
7e08e37319 Merge branch 'feature/decoding-optimization' into develop 2024-01-27 18:43:12 +01:00
Oliver Vogel
5a3e8fd7bd Add color processor tests 2024-01-27 18:40:28 +01:00
Oliver Vogel
05cf4fdaa5 Add tests 2024-01-27 18:30:03 +01:00
Oliver Vogel
19578de8d4 Move media type detection methods to abstract class 2024-01-27 17:58:55 +01:00
Oliver Vogel
6dcc450eee Fix bug & add tests 2024-01-27 17:45:00 +01:00