File: target.lua

package info (click to toggle)
lua-vips 1.1.12-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 772 kB
  • sloc: makefile: 2
file content (18 lines) | stat: -rw-r--r-- 378 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
local vips = require "vips"

if #arg ~= 2 then
    error("Usage: lua target.lua ~/pics/k2.png .avif > x")
end

local infilename = arg[1]
local fmt = arg[2]

local descriptor = {
    stdin = 0,
    stdout = 1,
    stderr = 2,
}

local image = vips.Image.new_from_file(infilename)
local target = vips.Target.new_to_descriptor(descriptor.stdout)
image:write_to_target(target, fmt)