Jp2 batch converter

From OpenSimulator

(Difference between revisions)
Jump to: navigation, search
m
m
Line 1: Line 1:
 +
==Description==
 +
This is a simple batch converter that creates jp2 files out of directory of jpg files.
 +
 +
==Usage==
 +
Put the code in a file named jasper.pl, and copy it to the directory where your jpg's are. Call the script:
 +
perl jesper.pl
 +
 +
==Code==
 
  ######################################
 
  ######################################
 
  #
 
  #
Line 8: Line 16:
 
  # to jp2 files...
 
  # to jp2 files...
 
  ######################################
 
  ######################################
 
==Description==
 
This is a simple batch converter that creates jp2 files out of directory of jpg files.
 
 
==Usage==
 
Put the code in a file named jasper.pl, and copy it to the directory where your jpg's are. Call the script:
 
perl jesper.pl
 
 
==Code==
 
 
  #!/usr/bin/perl
 
  #!/usr/bin/perl
 
  $iteration=1;
 
  $iteration=1;

Revision as of 07:20, 20 February 2008

Description

This is a simple batch converter that creates jp2 files out of directory of jpg files.

Usage

Put the code in a file named jasper.pl, and copy it to the directory where your jpg's are. Call the script:

perl jesper.pl

Code

######################################
#
# jpg2jp2.pl
#
# by: Phrearch
#
# Easily converts a batch of jpg files
# to jp2 files...
######################################
#!/usr/bin/perl
$iteration=1;

foreach my $file(`ls *.jpg`) {
	chop($file);
	system("jasper --input $file --output $iteration.jp2 -T jp2;");
	$iteration++;
	}
Personal tools
General
About This Wiki