view bin/get_xml_image.pl @ 1344:fbe51e90993a draft

collada file reader try various test.but it is incorrect move.
author Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
date Fri, 13 Jan 2012 08:56:49 +0900
parents 3e1caef39798
children
line wrap: on
line source

#!/usr/bin/perl

use MIME::Base64;
my $image;
my $buf;

while(<>) {
    if (/<image name="(.*)">/) {
	$image= $1;
        $buf = '';
    } elsif (/<\/image>/ ) {
	open(OUT, ">/tmp/$image") ;
	print OUT decode_base64($buf);
        $image = '';
    } elsif ($image) {
	$buf .= $_;
    }
}