Skip to content

Commit

Permalink
add gif copyCrop test
Browse files Browse the repository at this point in the history
  • Loading branch information
brendan-duncan committed Nov 10, 2024
1 parent 91915a7 commit 14740da
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
Binary file added test/_data/gif/homer.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions test/transform/copy_crop_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,20 @@ import '../_test_util.dart';

void main() {
group('Transform', () {
test('crop with radius', () async {
final g1 = await decodeGifFile('test/_data/gif/homer.gif');
final g2 = copyCrop(
g1!,
x: 0,
y: 0,
width: 500, // this is just the width of the original animation
height: 375, // this is just the height of the original animation
radius: 100,
);
await encodeGifFile('$testOutputPath/transform/copyCrop_radius.gif', g2);
await encodePngFile('$testOutputPath/transform/copyCrop_radius.png', g2);
});

test('copyCrop', () {
final bytes = File('test/_data/png/buck_24.png').readAsBytesSync();
final i0 = PngDecoder().decode(bytes)!;
Expand Down

0 comments on commit 14740da

Please sign in to comment.