Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Right now I have this (as little2big), which doesn't work:
Then I try:#!/usr/bin/perl die "Usage: $0 filename\n" unless @ARGV == 1; my $file = shift; my $buf; open IN, $file or die "Can't read $file: $!\n"; while (read(IN, $buf, 4)) { print pack "N", unpack "V", $buf; } close IN;
When I do this, all I get is "data" as a file type.little2big little-endian.tif >big-endian.tif
I've also tried reading 2 bytes and then using the pack/unpack templates n/v, but it doesn't flip anything correctly.
What am I missing? I feel like a Dumass. Thanks...
-Nate
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to flip little-endian TIFF to big-endian?
by Zaxo (Archbishop) on Dec 19, 2003 at 23:23 UTC | |
by Anonymous Monk on Dec 20, 2003 at 00:30 UTC | |
|
Re: How to flip little-endian TIFF to big-endian?
by oha (Friar) on Dec 19, 2003 at 23:36 UTC | |
by Roger (Parson) on Dec 20, 2003 at 06:48 UTC |