Skip to content

Commit 1065ef9

Browse files
committed
README and version
1 parent 1ccd752 commit 1065ef9

File tree

3 files changed

+48
-4
lines changed

3 files changed

+48
-4
lines changed

library/CHANGELOG.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
# CHANGELOG
22

33
- [CHANGELOG](#changelog)
4+
- [2.1.0](#210)
5+
- [What's Changed](#whats-changed)
46
- [2.0.0](#200)
57
- [1.1.0](#110)
6-
- [What's Changed](#whats-changed)
8+
- [What's Changed](#whats-changed-1)
79
- [New Contributors](#new-contributors)
810
- [1.0.0](#100)
911
- [0.3.0](#030)
@@ -12,6 +14,18 @@
1214
- [0.1.1](#011)
1315
- [0.1.0](#010)
1416

17+
## 2.1.0
18+
19+
Feature:
20+
21+
- Add `needRotate` for `Size`
22+
23+
### What's Changed
24+
25+
- Add needRotate for Size by @CaiJingLong in <https://github.com/CaiJingLong/dart_image_size_getter/pull/20>
26+
27+
**Full Changelog**: <https://github.com/CaiJingLong/dart_image_size_getter/compare/http_input-2.0.0...library-2.1.0>
28+
1529
## 2.0.0
1630

1731
New feature:

library/README.md

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ Just support jpeg, gif, png, webp, bmp.
66

77
## Usage
88

9+
### Image of File
10+
911
```dart
1012
import 'dart:io';
1113
@@ -32,7 +34,7 @@ void main(List<String> arguments) async {
3234
3335
```
3436

35-
MemoryImage
37+
### Image of Memory
3638

3739
```dart
3840
import 'package:image_size_getter/image_size_getter.dart';
@@ -43,11 +45,37 @@ void foo(Uint8List image){
4345
}
4446
```
4547

48+
### Image of Http
49+
50+
See [HttpInput][].
51+
52+
## About Size
53+
54+
The size contains width and height.
55+
56+
But some image have orientation.
57+
Such as jpeg, when the orientation of exif is 5, 6, 7 or 8, the width and height will be swapped.
58+
59+
We can use next code to get width and height.
60+
61+
```dart
62+
void foo(File file) {
63+
final size = ImageSizeGetter.getSize(FileInput(file));
64+
if (size.needRotate) {
65+
final width = size.height;
66+
final height = size.width;
67+
print('width = $width, height = $height');
68+
} else {
69+
print('width = ${size.width}, height = ${size.height}');
70+
}
71+
}
72+
```
73+
4674
## AsyncImageInput
4775

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

50-
A typical use case is [http_input](https://pub.dev/packages/image_size_getter_http_input).
78+
A typical use case is [http_input][HttpInput].
5179

5280
## Custom
5381

@@ -195,3 +223,5 @@ print('memoryImageSize = $memoryImageSize');
195223
## LICENSE
196224

197225
Apache 2.0
226+
227+
[HttpInput]: https://pub.dev/packages/image_size_getter_http_input

library/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: image_size_getter
22
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.
3-
version: 2.0.0
3+
version: 2.1.0
44
homepage: https://github.com/CaiJingLong/dart_image_size_getter/tree/master/library
55
# publish_to: https://pub.dev
66

0 commit comments

Comments
 (0)