Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add example error messages #64

Merged
merged 3 commits into from
Mar 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion example/buffer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@

local vips = require "vips"

local f = io.open(arg[1], "rb")
if #arg ~= 1 then
print("usage: luajit buffer.lua image-file")
error()
end
local f = assert(io.open(arg[1], "rb"))
local content = f:read("*all")

local im = vips.Image.new_from_buffer(content, "", {access = "sequential"})
Expand Down
4 changes: 4 additions & 0 deletions example/watermark.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ local vips = require "vips"
-- uncomment for very chatty output
-- vips.log.enable(true)

if #arg ~= 3 then
print("usage: luajit watermark.lua input-image-file output-image-file text")
error()
end
local im = vips.Image.new_from_file(arg[1], {access = "sequential"})

-- make the text mask
Expand Down
Loading