Invalid specification for coordinate_range values
kenshaw opened this issue · comments
The coordinate_range
field is specified as Default
(8-bit) and Reduced
(16-bit), however, the reference implementation is flipped, using u8
for reduced
and u16
for default
-- from lib/parsing.zig
:
const width: u32 = switch (range) {
.reduced => mapZeroToMax(try reader.readIntLittle(u8)),
.default => mapZeroToMax(try reader.readIntLittle(u16)),
.enhanced => std.math.cast(u32, mapZeroToMax(try reader.readIntLittle(u32))) catch return error.InvalidData,
};
const height: u32 = switch (range) {
.reduced => mapZeroToMax(try reader.readIntLittle(u8)),
.default => mapZeroToMax(try reader.readIntLittle(u16)),
.enhanced => std.math.cast(u32, mapZeroToMax(try reader.readIntLittle(u32))) catch return error.InvalidData,
};
This appears to have been fixed in 49ba3c0. I was working off an old PDF.
This appears to have been fixed in 49ba3c0. I was working off an old PDF.
Yeah, you're not the first person finding this. Thanks for the report!