added back script, removed unnecessary script
parent
b3a35e4521
commit
ef102f34e6
@ -0,0 +1,17 @@
|
|||||||
|
#!/bin/dash
|
||||||
|
#ffconv - Batch convert from one format to another
|
||||||
|
echo Convert from...
|
||||||
|
read ext
|
||||||
|
echo Convert to...
|
||||||
|
read toext
|
||||||
|
|
||||||
|
for i in *.$ext; do ffmpeg -i "$i" "${i%.*}.$toext"; done
|
||||||
|
|
||||||
|
while true; do
|
||||||
|
read -p "Delete original files? " yn
|
||||||
|
case $yn in
|
||||||
|
[Yy]* ) rm *.$ext; exit;;
|
||||||
|
[Nn]* ) exit;;
|
||||||
|
* ) printf "Please answer yes or no. ";;
|
||||||
|
esac
|
||||||
|
done
|
||||||
@ -1,45 +0,0 @@
|
|||||||
#! /usr/bin/perl -w
|
|
||||||
use strict;
|
|
||||||
use List::Util qw[max];
|
|
||||||
|
|
||||||
# read a GIMP gpl palette file and write out a netpbm PPM image
|
|
||||||
# Liam Quin, https://www.delightfulcomputing.com/ 2021
|
|
||||||
|
|
||||||
my $inheader = 1;
|
|
||||||
my @colours;
|
|
||||||
my $max = 0;
|
|
||||||
while (<>) {
|
|
||||||
chomp;
|
|
||||||
if ($inheader) {
|
|
||||||
if (m/^GIMP Palette/) {
|
|
||||||
next;
|
|
||||||
}
|
|
||||||
if (m/^NameL/) {
|
|
||||||
next;
|
|
||||||
}
|
|
||||||
if (m/^#/) {
|
|
||||||
$inheader = 0;
|
|
||||||
next;
|
|
||||||
}
|
|
||||||
} elsif (m/^\s*(\d+)\s+(\d+)\s+(\d+).*$/) {
|
|
||||||
push @colours, [ $1, $2, $3 ];
|
|
||||||
$max = max($max, $1, $2, $3);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!@colours) {
|
|
||||||
die "$0: no colours found";
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($max <= 0) {
|
|
||||||
die "$0: max value found is 0 which I think is an all-black palette";
|
|
||||||
}
|
|
||||||
|
|
||||||
# our image will be 1 pixel wide...
|
|
||||||
print "P3\n1 " . scalar(@colours) . "\n";
|
|
||||||
print "${max}\n";
|
|
||||||
|
|
||||||
# now the image data
|
|
||||||
foreach (@colours) {
|
|
||||||
print $_->[0], " ", $_->[1], " ", $_->[2], "\n";
|
|
||||||
}
|
|
||||||
Loading…
Reference in New Issue