Skip to content

Commit

Permalink
Use intervention/image for image operations
Browse files Browse the repository at this point in the history
  • Loading branch information
WyriHaximus committed May 30, 2024
1 parent e4222ce commit 884d185
Show file tree
Hide file tree
Showing 7 changed files with 218 additions and 82 deletions.
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ The stitcher needs two things:

declare(strict_types=1);

use Intervention\Image\Drivers\Gd\Driver;
use Intervention\Image\ImageManager;
use WyriHaximus\TileStitcher\Coordinate;
use WyriHaximus\TileStitcher\Dimensions;
use WyriHaximus\TileStitcher\Stitcher;
Expand All @@ -41,7 +43,13 @@ $tiles = [
),
];

Stitcher::stitch(
$stitcher = new Stitcher(
new ImageManager(
new Driver(),
),
);

$stitcher->stitch(
Map::calculate(
new Dimensions(512, 512),
...$tiles,
Expand All @@ -58,9 +66,9 @@ The result:

- [X] `Map::calculateMap` method to calculate the size of the resulting map image
- [X] `Switcher::stitch` method to take the `Map` and stitch it together into an image
- [ ] Pick up desired image format from render output argument, it's PNG only now
- [X] Pick up desired image format from render output argument, it's PNG only now
- [ ] Support pointing at directory and pick up all images utilizing a callable to parse coordinates
- [ ] Switch to abstraction layer for image operations
- [X] Switch to abstraction layer for image operations
- [ ] Dynamic tile sizes + scaling up any tiles smaller than the largest tile

# License
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@
],
"require": {
"php": "^8.2",
"ext-gd": "^8.2",
"intervention/image": "^3.6",
"thecodingmachine/safe": "^2.5"
},
"require-dev": {
"ext-gd": "^8.2",
"wyrihaximus/test-utilities": "^6.0.7"
},
"autoload": {
Expand Down
Loading

0 comments on commit 884d185

Please sign in to comment.