-
Notifications
You must be signed in to change notification settings - Fork 52
Description
Hi, thanks for pyvips, I've just started using it for a project and it's working great.
Is there a way to get information about the file I've loaded (e.g image format and importantly whether it's tiled) using pyvips? I've been messing around and looking through the docs but I haven't found what I'm looking for.
I am dealing with large (in the realm 40k x 40k) images in my project, but I'm only working with relatively small regions in these images, so when dealing with tiled tiff images pyvips is giving me really excellent performance, orders of magnitude faster than the old imagemagick code it's replacing. Much much faster than e.g jpeg.
Due to the advantage of tiled tiff, I'd like to have a feature in my software to detect if a user-provided image is a tiled tiff and offer to automatically convert it if it isn't.
I've written a 'convert to tiled tiff' method which saves my files in a format optimal for processing and this works well, but I can't seem to find any way to determine whether a file the user has provided is a tiled tiff or not.
I think I could perhaps use tiffload
rather than Image.new_from_file
, but I'd like my users to be able to easily load any image type supported by vips, so that's not ideal.
Does pyvips have any way to figure this out? I've been looking at Image.sequential
, it seems like this is close to what I want, but it seems that open any file in random mode, e.g a jpeg. I also had a look at the output from .get_fields
, but there doesn't seem to be much there that's helpful to me. Does pyvips have any way of figuring out what I want to know?
Any tips you have would be great. Thanks very much for your time :)