In
-tile - the '-' is a option argument, Which for
-tile is a explicit image read. Actually this is something I want to change in IMv7 as I prefer tile to just use (and remove) the last image on the current image list, that way you can set a in-memory image to use for tiling.
If
- is not an argument, then IM will first look to see if it is an option. It isn't.
In that situation IM treats it as a 'implicit read' operation. That is it will think of it as being a filename argument to explicitly perform
-read {arg} (NOTE that the explict
-read option is a new operator option in IMv7, and can be used to make it clear what you are doing.
It also lets you read from a filename that happens to also match an otpion name. For example:
-read -tile will explicitly read from a file named "-tile"
A image filename of "
-" is equivalent to a "
fd:0" coder operation. Standard input is opened, ALL images are read, and (in IMv6) the file descriptor (stdin) is closed! In IMv7 I want to be able to perform single image reads, and not have the standard input closed, so later you can read another image (or something else) from the standard input (or whatever) pipeline.
NOTE: recent bug fixes includes a bug fix for reading from another file descriptor, as such this now works (very advanced shell scripting) see BASH FAQ
Code: Select all
convert rose: test_image.png # create image
exec 5<test_image.png # get shell to open image on fd 5
convert fd:5 info: # convert reads fd 5
exec 5<&- # shell closes fd 5
rm test_image.png # clean up test image
IMv7 script options can come from a file, pipeline, or file descriptor, in just the same way.
I designed its reading carefully, so if single image reads from pipes become possible
then you should be able to mix options and images in the same pipeline!
NOTE single image reads will only work for image file formats that have a defined end-of-data point.
That is streaming image files formats
MIFF does, PbmPlus does, but TXT image do not.
Actually TXT images can 'stream' but they do not have a defined end-of-data to the format
The start of the next image is used to end the previous image. so can not be used, as it stands.
I would class a 'newline' or 'return' character as the end-of-data for a label: image
but perhaps a EOT character (Ctrl-D) would be better for this purpose!