Skip to content

Commit

Permalink
revise docs
Browse files Browse the repository at this point in the history
add a note about set and remove

see #76

thanks Tychology
  • Loading branch information
jcupitt committed Apr 6, 2024
1 parent 5afc004 commit 78179d1
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -320,11 +320,25 @@ This creates a new metadata item of the specified type, name and value.

This changes the value of an existing field, but will not change its type.

You can't use `set()` to change core fields such as like `width` or
`interpretation`. Use `copy()` instead.`

Image references will be shared by the operation cache, so modifying an image
can chage an image somewhere else in your program. Before changing an image,
you must make sure you own a private copy of an image with `copy`.

```lua
local new_image = image:copy()`
new_image:set("orientation", 7)
```

### `boolean = vips.Image.remove(image, field_name)`

This will remove a piece of metadata. It returns `true` if an item was
successfully removed, `false` otherwise.

As with `set`, you must use copy before removing a metadata item.

## Call any libvips operation

You can call any libvips operation as a member function, for example
Expand Down

0 comments on commit 78179d1

Please sign in to comment.