pyvips icon indicating copy to clipboard operation
pyvips copied to clipboard

Online source for images (download and convert)

Open dreaded369 opened this issue 3 years ago • 2 comments

I'm getting errors when trying to use a URL for the source of an image load - "VipsForeignLoad... jpg does not exist" Am I right in assuming that online sources of images aren't able to be processed by pyvips?

I was hoping to avoid actually saving the original remote image (and then circling back to delete it).

Alternatively would it be possible to pass a response from Requests straight to pyvips and avoid a disk write?

dreaded369 avatar Oct 28 '22 09:10 dreaded369

Hi @dreadedhamish,

Sure, it should work.

Did you see the examples? This does load / save to stdin / stdout:

https://github.com/libvips/pyvips/blob/master/examples/stdio.py

It'd simple to hook it up to a pair of pipes. This one does a full custom source and target:

https://github.com/libvips/pyvips/blob/master/examples/connection.py

So you could connect pyvips to anything that can read or write a sequence of bytes.

jcupitt avatar Oct 28 '22 09:10 jcupitt

@jcupitt thanks so much! I had a good look around but perhaps I don't have all the terminology down yet.

dreaded369 avatar Oct 28 '22 10:10 dreaded369