-
-
Notifications
You must be signed in to change notification settings - Fork 676
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vips CLI specify file format with pipes #433
Comments
Hi Felix, this has been talked about a bit, there's even an experimental branch with support for streams: https://github.com/jcupitt/libvips/tree/load-from-stream It can run this C program: https://gist.github.com/jcupitt/ff21f5b8d1dd6ba54c6f It reads a series of images from a socket, processes them, and sends them off to another socket, all without having to load the whole image. The aim was to support AWS buckets, but it would work for command-line pipes too, with a small amount of extra work. There was a long chat about it on this issue: I gave up for a bit, then it bitrotted, then I tried to clean it up ready to merge to master, and hit some problems. It needs a bit more work still :/ |
I wasn't talking about streaming multiple images, although that would be a cool feature. The main idea is to be able to set the loader or saver (or roughly the file type), when it can not be inferred from the file extension. I'm sure there are more issues for filetypes that require seeking, but eg. jpeg, png, ppm would work fine. This would also be helpful, when there are multiple implementations that can emit or load the same file type. For example PDF could be loaded with either pdfload or magickload. |
I think you'd need the streaming stuff for /dev/stdin to work. For example, this fails:
The file loaders expect to be able to open their input several times. The streaming stuff would add a read buffer that would make this possible -- the many images from a stream thing is just a bonus. |
This is added in 8.9. You can write eg.
The release notes have more information: https://libvips.github.io/libvips/2019/12/11/What's-new-in-8.9.html |
In imagemagick I can read from and write to pipes and specify their format:
In the vips cli tools I can use /dev/stdin or /dev/stdout, but there doesn't seem to be a way to indicate the file format, which limits how much you can accomplish using pipes in vips.
It would be great if vips allowed to specify/override the loader/saver for input and output images.
Example syntax:
This would also allow chaining multiple vips cli operations without paying the disk i/o for writing to .v files.
The text was updated successfully, but these errors were encountered: