diff options
| author | Hisham Aburaqibah <haburaqibah@giga.ly> | 2025-01-16 16:21:50 +0200 |
|---|---|---|
| committer | Jeroen van Rijn <Kelimion@users.noreply.github.com> | 2025-09-08 17:13:03 +0200 |
| commit | 8644f3bebabf462a42af6ad82c4b9cab8f3d8b4c (patch) | |
| tree | 851304e409d1dd786843440121eb18d337fbff5d /core/image | |
| parent | a6f18c336772a735a70b439c7ffb687e3fb92efb (diff) | |
image/jpeg: better pack APP0 structs
Diffstat (limited to 'core/image')
| -rw-r--r-- | core/image/common.odin | 12 | ||||
| -rw-r--r-- | core/image/jpeg/jpeg.odin | 12 |
2 files changed, 12 insertions, 12 deletions
diff --git a/core/image/common.odin b/core/image/common.odin index 6d67115a1..5279166ef 100644 --- a/core/image/common.odin +++ b/core/image/common.odin @@ -610,19 +610,19 @@ JFIF_Unit :: enum byte { JFIF_APP0 :: struct { version: u16be, - units: JFIF_Unit, x_density: u16be, y_density: u16be, - x_thumbnail: byte, - y_thumbnail: byte, - thumbnail: []RGB_Pixel `fmt:"-"`, + units: JFIF_Unit, + x_thumbnail: u8, + y_thumbnail: u8, greyscale_thumbnail: bool, + thumbnail: []RGB_Pixel `fmt:"-"`, } JFXX_APP0 :: struct { extension_code: JFXX_Extension_Code, - x_thumbnail: int, - y_thumbnail: int, + x_thumbnail: u8, + y_thumbnail: u8, thumbnail: []byte `fmt:"-"`, } diff --git a/core/image/jpeg/jpeg.odin b/core/image/jpeg/jpeg.odin index 53320cb38..945c51877 100644 --- a/core/image/jpeg/jpeg.odin +++ b/core/image/jpeg/jpeg.odin @@ -270,13 +270,13 @@ load_from_context :: proc(ctx: ^$C, options := Options{}, allocator := context.a } info.jfif_app0 = image.JFIF_APP0{ version, - units, x_density, y_density, + units, cast(u8)x_thumbnail, cast(u8)y_thumbnail, - thumbnail, greyscale_thumbnail, + thumbnail, } img.metadata = info } @@ -330,8 +330,8 @@ load_from_context :: proc(ctx: ^$C, options := Options{}, allocator := context.a } info.jfxx_app0 = image.JFXX_APP0{ extension_code, - x_thumbnail, - y_thumbnail, + cast(u8)x_thumbnail, + cast(u8)y_thumbnail, thumbnail, } img.metadata = info @@ -359,8 +359,8 @@ load_from_context :: proc(ctx: ^$C, options := Options{}, allocator := context.a } info.jfxx_app0 = image.JFXX_APP0{ extension_code, - x_thumbnail, - y_thumbnail, + cast(u8)x_thumbnail, + cast(u8)y_thumbnail, pixels, } img.metadata = info |