this repo has no description
13
fork

Configure Feed

Select the types of activity you want to include in your feed.

Update to upstream zigimg and adapt to new API

Amp-Thread-ID: https://ampcode.com/threads/T-7a962987-d2b4-4e03-b07a-d62d692ffa2f
Co-authored-by: Amp <amp@ampcode.com>

+7 -8
+2 -3
build.zig.zon
··· 5 5 .minimum_zig_version = "0.15.1", 6 6 .dependencies = .{ 7 7 .zigimg = .{ 8 - // TODO .url = "git+https://github.com/zigimg/zigimg", 9 - .url = "https://github.com/ivanstepanovftw/zigimg/archive/d7b7ab0ba0899643831ef042bd73289510b39906.tar.gz", 10 - .hash = "zigimg-0.1.0-8_eo2vHnEwCIVW34Q14Ec-xUlzIoVg86-7FU2ypPtxms", 8 + .url = "git+https://github.com/zigimg/zigimg#eab2522c023b9259db8b13f2f90d609b7437e5f6", 9 + .hash = "zigimg-0.1.0-8_eo2vUZFgAAtN1c6dAO5DdqL0d4cEWHtn6iR5ucZJti", 11 10 }, 12 11 .uucode = .{ 13 12 .url = "git+https://github.com/jacobsandlund/uucode#5f05f8f83a75caea201f12cc8ea32a2d82ea9732",
+1 -1
examples/image.zig
··· 36 36 37 37 var read_buffer: [1024 * 1024]u8 = undefined; // 1MB buffer 38 38 var img1 = try vaxis.zigimg.Image.fromFilePath(alloc, "examples/zig.png", &read_buffer); 39 - defer img1.deinit(); 39 + defer img1.deinit(alloc); 40 40 41 41 const imgs = [_]vaxis.Image{ 42 42 try vx.transmitImage(alloc, tty.writer(), &img1, .rgba),
+4 -4
src/Vaxis.zig
··· 995 995 const buf = switch (format) { 996 996 .png => png: { 997 997 const png_buf = try arena.allocator().alloc(u8, img.imageByteSize()); 998 - const png = try img.writeToMemory(png_buf, .{ .png = .{} }); 998 + const png = try img.writeToMemory(arena.allocator(), png_buf, .{ .png = .{} }); 999 999 break :png png; 1000 1000 }, 1001 1001 .rgb => rgb: { 1002 - try img.convert(.rgb24); 1002 + try img.convert(arena.allocator(), .rgb24); 1003 1003 break :rgb img.rawBytes(); 1004 1004 }, 1005 1005 .rgba => rgba: { 1006 - try img.convert(.rgba32); 1006 + try img.convert(arena.allocator(), .rgba32); 1007 1007 break :rgba img.rawBytes(); 1008 1008 }, 1009 1009 }; ··· 1027 1027 .path => |path| try zigimg.Image.fromFilePath(alloc, path, &read_buffer), 1028 1028 .mem => |bytes| try zigimg.Image.fromMemory(alloc, bytes), 1029 1029 }; 1030 - defer img.deinit(); 1030 + defer img.deinit(alloc); 1031 1031 return self.transmitImage(alloc, tty, &img, .png); 1032 1032 } 1033 1033