Skip to content

Commit e74e132

Browse files
committed
v11.0.0-alpha.2 fix not finding correct sixel band start
1 parent d079ef3 commit e74e132

3 files changed

Lines changed: 12 additions & 4 deletions

File tree

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "ratatui-image"
3-
version = "11.0.0-alpha.1"
3+
version = "11.0.0-alpha.2"
44
edition = "2024"
55
autoexamples = true
66
authors = ["Benjamin Große <ste3ls@gmail.com>"]

src/sliced.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,10 +351,15 @@ mod sixel_slice {
351351
b'"' => {
352352
// raster attribute line, skip to next `#` or sixel data char
353353
i += 1;
354-
while i < bytes.len() && bytes[i] != b'#' && !(63..=126).contains(&bytes[i]) {
354+
while i < bytes.len()
355+
&& bytes[i] != b'#'
356+
&& bytes[i] != b'-'
357+
&& !(63..=126).contains(&bytes[i])
358+
{
355359
i += 1;
356360
}
357361
}
362+
b'-' => break,
358363
b'#' => {
359364
// peek ahead: is this `#digits;` (color def) or `#digits` followed by data?
360365
let start = i;
@@ -365,7 +370,10 @@ mod sixel_slice {
365370
}
366371
if i < bytes.len() && bytes[i] == b';' {
367372
// it's a color definition — skip the rest of it
368-
while i < bytes.len() && bytes[i] != b'#' && !(63..=126).contains(&bytes[i])
373+
while i < bytes.len()
374+
&& bytes[i] != b'#'
375+
&& bytes[i] != b'-'
376+
&& !(63..=126).contains(&bytes[i])
369377
{
370378
i += 1;
371379
}

0 commit comments

Comments
 (0)