Skip to content

Commit 150993a

Browse files
jcupittrolandlo
authored andcommitted
revise docs
add a note about set and remove see #76 thanks Tychology
1 parent b2cfeb6 commit 150993a

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,11 +330,25 @@ This creates a new metadata item of the specified type, name and value.
330330

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

333+
You can't use `set()` to change core fields such as like `width` or
334+
`interpretation`. Use `copy()` instead.`
335+
336+
Image references will be shared by the operation cache, so modifying an image
337+
can change an image somewhere else in your program. Before changing an image,
338+
you must make sure you own a private copy of an image with `copy`.
339+
340+
```lua
341+
local new_image = image:copy()`
342+
new_image:set("orientation", 7)
343+
```
344+
333345
### `boolean = vips.Image.remove(image, field_name)`
334346

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

350+
As with `set`, you must use copy before removing a metadata item.
351+
338352
## Call any libvips operation
339353

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

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy