地圖 (Jido) is a lightweight Unix TUI file explorer designed for speed and simplicity.

chore: remove buf_size from Image

+2 -2
-1
src/app.zig
··· 80 }; 81 82 pub const Image = struct { 83 - const buf_size = (1024 * 1024) * 5; // 5mb 84 const Status = enum { 85 ready, 86 processing,
··· 80 }; 81 82 pub const Image = struct { 83 const Status = enum { 84 ready, 85 processing,
+2 -1
src/drawer.zig
··· 682 } 683 684 fn loadImage(app: *App, path: []const u8) error{OutOfMemory}!void { 685 - var buf: [(1024 * 1024) * 5]u8 = undefined; 686 const data = vaxis.zigimg.Image.fromFilePath(app.alloc, path, &buf) catch { 687 app.images.mutex.lock(); 688 if (app.images.cache.getPtr(path)) |entry| { ··· 702 if (app.images.cache.getPtr(path)) |entry| { 703 entry.status = .ready; 704 entry.data = data; 705 } else { 706 const message = try std.fmt.allocPrint(app.alloc, "Failed to load image '{s}' - error occurred while attempting to add image to cache.", .{path}); 707 defer app.alloc.free(message);
··· 682 } 683 684 fn loadImage(app: *App, path: []const u8) error{OutOfMemory}!void { 685 + var buf: [(1024 * 1024) * 5]u8 = undefined; // 5mb 686 const data = vaxis.zigimg.Image.fromFilePath(app.alloc, path, &buf) catch { 687 app.images.mutex.lock(); 688 if (app.images.cache.getPtr(path)) |entry| { ··· 702 if (app.images.cache.getPtr(path)) |entry| { 703 entry.status = .ready; 704 entry.data = data; 705 + entry.path = path; 706 } else { 707 const message = try std.fmt.allocPrint(app.alloc, "Failed to load image '{s}' - error occurred while attempting to add image to cache.", .{path}); 708 defer app.alloc.free(message);