Skip to content

Commit 3a5d8a9

Browse files
Merge pull request #333 from kirdaybov/master
Update image dependency from 0.23 to 0.24
2 parents 32f6d2d + fdd53ba commit 3a5d8a9

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ The `gltf` crate adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
99
## Unreleased
1010

1111
- Fix relative file path imports with url encoded characters.
12+
- Update dependency on `image` crate from 0.23 to 0.24.
1213

1314
## [1.0.0] - 2022-01-29
1415

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ urlencoding = "2.1"
3232
default-features = false
3333
features = ["jpeg", "png"]
3434
optional = true
35-
version = "0.23"
35+
version = "0.24"
3636

3737
[features]
3838
default = ["import", "utils", "names"]

src/image.rs

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,6 @@ pub enum Format {
2121
/// Red, green, blue, alpha.
2222
R8G8B8A8,
2323

24-
/// Blue, green, red.
25-
B8G8R8,
26-
27-
/// Blue, green, red, alpha.
28-
B8G8R8A8,
29-
3024
/// Red only (16 bits).
3125
R16,
3226

@@ -38,6 +32,12 @@ pub enum Format {
3832

3933
/// Red, green, blue, alpha (16 bits).
4034
R16G16B16A16,
35+
36+
/// Red, green, blue (32 bits float)
37+
R32G32B32FLOAT,
38+
39+
/// Red, green, blue, alpha (32 bits float)
40+
R32G32B32A32FLOAT,
4141
}
4242

4343
/// Describes an image data source.
@@ -145,15 +145,16 @@ impl Data {
145145
DynamicImage::ImageLumaA8(_) => Format::R8G8,
146146
DynamicImage::ImageRgb8(_) => Format::R8G8B8,
147147
DynamicImage::ImageRgba8(_) => Format::R8G8B8A8,
148-
DynamicImage::ImageBgr8(_) => Format::B8G8R8,
149-
DynamicImage::ImageBgra8(_) => Format::B8G8R8A8,
150148
DynamicImage::ImageLuma16(_) => Format::R16,
151149
DynamicImage::ImageLumaA16(_) => Format::R16G16,
152150
DynamicImage::ImageRgb16(_) => Format::R16G16B16,
153151
DynamicImage::ImageRgba16(_) => Format::R16G16B16A16,
152+
DynamicImage::ImageRgb32F(_) => Format::R32G32B32FLOAT,
153+
DynamicImage::ImageRgba32F(_) => Format::R32G32B32A32FLOAT,
154+
_ => unreachable!("Unmatched DynamicImage format"),
154155
};
155156
let (width, height) = image.dimensions();
156-
let pixels = image.to_bytes();
157+
let pixels = image.into_bytes();
157158
Data {
158159
format,
159160
width,

0 commit comments

Comments
 (0)