Fixed compilation in qoi for 32-bit platforms
This commit is contained in:
parent
e0ab3829b1
commit
2e6a962a82
1 changed files with 2 additions and 2 deletions
|
@ -49,7 +49,7 @@ proc decodeQoiRaw*(data: string): Qoi {.raises: [PixieError].} =
|
||||||
if channels notin {3, 4} or colorspace notin {0, 1}:
|
if channels notin {3, 4} or colorspace notin {0, 1}:
|
||||||
raise newException(PixieError, "Invalid QOI header")
|
raise newException(PixieError, "Invalid QOI header")
|
||||||
|
|
||||||
if width.int * height.int > uint32.high.int:
|
if width.int * height.int > uint32.high.int64:
|
||||||
raise newException(PixieError, "QOI is too large to decode")
|
raise newException(PixieError, "QOI is too large to decode")
|
||||||
|
|
||||||
result = Qoi()
|
result = Qoi()
|
||||||
|
@ -128,7 +128,7 @@ proc decodeQoi*(data: string): Image {.raises: [PixieError].} =
|
||||||
proc encodeQoi*(qoi: Qoi): string {.raises: [PixieError].} =
|
proc encodeQoi*(qoi: Qoi): string {.raises: [PixieError].} =
|
||||||
## Encodes raw QOI pixels to the QOI file format.
|
## Encodes raw QOI pixels to the QOI file format.
|
||||||
|
|
||||||
if qoi.width.int * qoi.height.int > uint32.high.int:
|
if qoi.width.int * qoi.height.int > uint32.high.int64:
|
||||||
raise newException(PixieError, "QOI is too large to encode")
|
raise newException(PixieError, "QOI is too large to encode")
|
||||||
|
|
||||||
# Allocate a buffer 3/4 the size of the pathological encoding
|
# Allocate a buffer 3/4 the size of the pathological encoding
|
||||||
|
|
Loading…
Reference in a new issue