Se você tem certeza de que os TIFFs concatenados são todos arquivos little-endian (49 49 2A 00 magic number), então este script Perl deve funcionar. Invoque como perl foo.pl < file.tif
#!/usr/bin/env perl
my $big_endian = "MM#!/usr/bin/env perl
my $big_endian = "MM%pre%*";
my $big_endian_regex = "MM%pre%\*";
my $little_endian = "II*%pre%";
my $little_endian_regex = "II\*%pre%";
my $tiff_magic = $little_endian;
my $tiff_magic_regex = $little_endian_regex;
my $n = 0;
my $fileprefix = "chunk";
my $buffer;
{ local $/ = undef; $buffer = <stdin>; }
my @images = split /${tiff_magic_regex}/, $buffer;
for my $image (@images) {
next if $image eq '';
my $file = sprintf("$fileprefix.%02d.tif", $n++);
open FILE, ">", $file or die "open $file: ";
print FILE $tiff_magic, $image or die "print $file: ";
close FILE or die "close $file: ";
}
exit 0;
*";
my $big_endian_regex = "MM%pre%\*";
my $little_endian = "II*%pre%";
my $little_endian_regex = "II\*%pre%";
my $tiff_magic = $little_endian;
my $tiff_magic_regex = $little_endian_regex;
my $n = 0;
my $fileprefix = "chunk";
my $buffer;
{ local $/ = undef; $buffer = <stdin>; }
my @images = split /${tiff_magic_regex}/, $buffer;
for my $image (@images) {
next if $image eq '';
my $file = sprintf("$fileprefix.%02d.tif", $n++);
open FILE, ">", $file or die "open $file: ";
print FILE $tiff_magic, $image or die "print $file: ";
close FILE or die "close $file: ";
}
exit 0;