Target

class pyvips.vtarget.Target(pointer)[source]

An output connection.

static new_to_descriptor(descriptor)[source]

Make a new target to write to a file descriptor (a small integer).

Make a new target that is attached to the descriptor. For example:

target = pyvips.Target.new_to_descriptor(1)

Makes a descriptor attached to stdout.

You can pass this target to (for example) write_to_target().

static new_to_file(filename)[source]

Make a new target to write to a file.

Make a new target that will write to the named file. For example:

target = pyvips.Target.new_to_file("myfile.jpg")

You can pass this target to (for example) write_to_target().

static new_to_memory()[source]

Make a new target to write to an area of memory.

Make a new target that will write to memory. For example:

target = pyvips.Target.new_to_memory()

You can pass this target to (for example) write_to_target().

After writing to the target, fetch the bytes from the target object with target.get(“blob”).