Tile n-pages of TIFF into 1 image
Posted: 2013-05-20T12:11:02-07:00
I am working on a web app that currently displays images in an archive by passing through output from convert directly to the browser. The PHP code that does this looks like this:
$cmd = "$convert '$imgpath' $options png:- ";
passthru( $cmd );
I have recently discovered that some of the source images are TIFFs that have two "pages", (they are scans of IDs -- one page is the front, the other is the back,) but only one page is being displayed. I would like to have convert take the second page and attach it on to one side of the first page such that both the front and back can be output as a single image.
I am aware that this can be done fairly easily using intermediate files, but I would really like to do it without using intermediate files for a variety of reasons. Multiple nested convert processes are fine as long as they don't generate temp files. What I mean by nested processes:
"convert arg1 -flag='$( another convert/something else call )' input_file png:-"
I would appreciate any ideas anyone has on how to do this.
I am using Linux, specifically Centos 5. I have these two versions of ImageMagick handy:
Version: ImageMagick 6.8.4-8 2013-04-10 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2013 ImageMagick Studio LLC
Features: DPC
Delegates: bzlib freetype jng jpeg lcms png ps tiff x zlib
Version: ImageMagick 6.4.9-10 2009-10-07 Q16 OpenMP http://www.imagemagick.org
Copyright: Copyright (C) 1999-2009 ImageMagick Studio LLC
I can compile another version if necessary.
$cmd = "$convert '$imgpath' $options png:- ";
passthru( $cmd );
I have recently discovered that some of the source images are TIFFs that have two "pages", (they are scans of IDs -- one page is the front, the other is the back,) but only one page is being displayed. I would like to have convert take the second page and attach it on to one side of the first page such that both the front and back can be output as a single image.
I am aware that this can be done fairly easily using intermediate files, but I would really like to do it without using intermediate files for a variety of reasons. Multiple nested convert processes are fine as long as they don't generate temp files. What I mean by nested processes:
"convert arg1 -flag='$( another convert/something else call )' input_file png:-"
I would appreciate any ideas anyone has on how to do this.
I am using Linux, specifically Centos 5. I have these two versions of ImageMagick handy:
Version: ImageMagick 6.8.4-8 2013-04-10 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2013 ImageMagick Studio LLC
Features: DPC
Delegates: bzlib freetype jng jpeg lcms png ps tiff x zlib
Version: ImageMagick 6.4.9-10 2009-10-07 Q16 OpenMP http://www.imagemagick.org
Copyright: Copyright (C) 1999-2009 ImageMagick Studio LLC
I can compile another version if necessary.