use strict; # convert jpeg to mci sub jpg2mci($) { my $jpg = shift; my $mci = ""; my $ver = "1.0.1"; my $dir = "tools" . $::dirsep . "jpg2mci-$ver"; my $tempfile = "$dir" . $::dirsep . "jpg2mci.tmp"; # just return the unmodified data if there's no converter unless (-x "$dir" . $::dirsep . "jpg2mci" . $::exesufx) { return(""); } open(TEMP, ">$tempfile") || die "Couldn't write to $tempfile"; binmode(TEMP); print TEMP $jpg; close(TEMP); open(MCI, "$dir" . $::dirsep . "jpg2mci" . $::exesufx . " -q < $tempfile |") || die "Couldn't read from jpg2mci" . $::exesufx; while() { $mci .= $_; } return($mci); } return(1);