tangled
alpha
login
or
join now
brookjeynes.dev
/
jido
7
fork
atom
地圖 (Jido) is a lightweight Unix TUI file explorer designed for speed and simplicity.
7
fork
atom
overview
issues
pulls
pipelines
chore: remove buf_size from Image
brookjeynes.dev
2 months ago
744d07a0
8f8ab449
+2
-2
2 changed files
expand all
collapse all
unified
split
src
app.zig
drawer.zig
-1
src/app.zig
···
80
80
};
81
81
82
82
pub const Image = struct {
83
83
-
const buf_size = (1024 * 1024) * 5; // 5mb
84
83
const Status = enum {
85
84
ready,
86
85
processing,
+2
-1
src/drawer.zig
···
682
682
}
683
683
684
684
fn loadImage(app: *App, path: []const u8) error{OutOfMemory}!void {
685
685
-
var buf: [(1024 * 1024) * 5]u8 = undefined;
685
685
+
var buf: [(1024 * 1024) * 5]u8 = undefined; // 5mb
686
686
const data = vaxis.zigimg.Image.fromFilePath(app.alloc, path, &buf) catch {
687
687
app.images.mutex.lock();
688
688
if (app.images.cache.getPtr(path)) |entry| {
···
702
702
if (app.images.cache.getPtr(path)) |entry| {
703
703
entry.status = .ready;
704
704
entry.data = data;
705
705
+
entry.path = path;
705
706
} else {
706
707
const message = try std.fmt.allocPrint(app.alloc, "Failed to load image '{s}' - error occurred while attempting to add image to cache.", .{path});
707
708
defer app.alloc.free(message);