Results 1568 comments of John Cupitt

Hi @jonasteuwen, You're right, it seems to be missing! I was sure we implemented this. `VipsSourceCustom` lets you implement a source by attaching handlers rather than having to make a...

Here's an old plain C example I found: ```C /* compile with: * gcc -g -Wall customsource.c `pkg-config vips --cflags --libs` */ #include typedef struct _FileState { FILE *handle; guint...

Hello again, sorry for not following up on this. VImage has a constructor for sources, `VImage::new_from_source()`, so (I think) you could probably remove your `create_image_from_source()`. Otherwise, sure, this looks nice!

Hi @bluebinary, libvips records the byte order of the writer, then when reading images back, will byte-swap if the order doesn't match native order. So (hopefully!) you shouldn't need to...

Ah I see, I hadn't thought of the metadata. Don't decode libraries for those blobs handle byte order for you? I think libexif does, XMP shouldn't matter, I've no idea...

No, libvips doesn't record the byte order reported by TIFF loader. I think you'd need to call libtiff directly to find that out. We could add a libvips metadata field...

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...

Hi @jonasteuwen, pyvips lets you fetch any libvips metadata with `get`. For example: ```python image = pyvips.Image.new_from_file("CMU-1.svs") profile = image.get("icc-profile-data") ``` You can see all the metadata that libvips can...

Ah you want to just fetch and process a small region, is that right? You could write: ```python image = pyvips.Image.new_from_file("CMU-1.svs", rgb=True).icc_transform("srgb") for y in range(0, image.height, 256): for x...

You can attach the profile from `openslide_lowlevel` as metadata to the pyvips image. Something like (untested): ```python owsi = openslide_lowlevel.open(str(filename)) profile = openslide_lowlevel.read_icc_profile(owsi) color_profile = io.BytesIO(profile).read() tile = owsi.read_region((x, y),...