Skip to content

Commit

Permalink
README and version
Browse files Browse the repository at this point in the history
  • Loading branch information
CaiJingLong committed Apr 13, 2022
1 parent 1ccd752 commit 1065ef9
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 4 deletions.
16 changes: 15 additions & 1 deletion library/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# CHANGELOG

- [CHANGELOG](#changelog)
- [2.1.0](#210)
- [What's Changed](#whats-changed)
- [2.0.0](#200)
- [1.1.0](#110)
- [What's Changed](#whats-changed)
- [What's Changed](#whats-changed-1)
- [New Contributors](#new-contributors)
- [1.0.0](#100)
- [0.3.0](#030)
Expand All @@ -12,6 +14,18 @@
- [0.1.1](#011)
- [0.1.0](#010)

## 2.1.0

Feature:

- Add `needRotate` for `Size`

### What's Changed

- Add needRotate for Size by @CaiJingLong in <https://github.com/CaiJingLong/dart_image_size_getter/pull/20>

**Full Changelog**: <https://github.com/CaiJingLong/dart_image_size_getter/compare/http_input-2.0.0...library-2.1.0>

## 2.0.0

New feature:
Expand Down
34 changes: 32 additions & 2 deletions library/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ Just support jpeg, gif, png, webp, bmp.

## Usage

### Image of File

```dart
import 'dart:io';
Expand All @@ -32,7 +34,7 @@ void main(List<String> arguments) async {
```

MemoryImage
### Image of Memory

```dart
import 'package:image_size_getter/image_size_getter.dart';
Expand All @@ -43,11 +45,37 @@ void foo(Uint8List image){
}
```

### Image of Http

See [HttpInput][].

## About Size

The size contains width and height.

But some image have orientation.
Such as jpeg, when the orientation of exif is 5, 6, 7 or 8, the width and height will be swapped.

We can use next code to get width and height.

```dart
void foo(File file) {
final size = ImageSizeGetter.getSize(FileInput(file));
if (size.needRotate) {
final width = size.height;
final height = size.width;
print('width = $width, height = $height');
} else {
print('width = ${size.width}, height = ${size.height}');
}
}
```

## AsyncImageInput

If your data source is read asynchronously, consider using `AsyncImageInput`.

A typical use case is [http_input](https://pub.dev/packages/image_size_getter_http_input).
A typical use case is [http_input][HttpInput].

## Custom

Expand Down Expand Up @@ -195,3 +223,5 @@ print('memoryImageSize = $memoryImageSize');
## LICENSE

Apache 2.0

[HttpInput]: https://pub.dev/packages/image_size_getter_http_input
2 changes: 1 addition & 1 deletion library/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: image_size_getter
description: Get image width and height, the library does not completely decode the image file, just read the metadata to get the image width and height.
version: 2.0.0
version: 2.1.0
homepage: https://github.com/CaiJingLong/dart_image_size_getter/tree/master/library
# publish_to: https://pub.dev

Expand Down

0 comments on commit 1065ef9

Please sign in to comment.