mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
[pngzop] Removed no-longer-used shell scripts
This commit is contained in:
@@ -1,30 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# pngzop_brute.sh
|
||||
|
||||
# For use in the pngzop project
|
||||
# Copyright 2013 by Glenn Randers-Pehrson
|
||||
# Released under the pngcrush license (equivalent to the libpng license)
|
||||
|
||||
# Extracts the concatenated data from the IDAT chunks in a set of PNG files,
|
||||
# recompresses them with zopfli, and embeds them in a new set of PNG files
|
||||
# with suffix ".png" replaced with "_pngzop_brute.png"
|
||||
|
||||
# Usage:
|
||||
# pngzop_brute *.png
|
||||
|
||||
# Standard Input: *.png
|
||||
# Output: *_pngzop_brute.png
|
||||
|
||||
# To do: Adjust zlib CMF to reflect actual windowBits required.
|
||||
|
||||
for x in $*
|
||||
do
|
||||
root=`echo $1 | sed -e s/.png$//`
|
||||
pngzop_get_ihdr.exe < $1 > ${root}_pngzop_brute.png
|
||||
pngzop_brute_zopfli.sh $1
|
||||
pngzop_zlib_to_idat.exe < ${root}.zlib >> ${root}_pngzop_brute.png
|
||||
rm ${root}.zlib
|
||||
pngzop_get_iend.exe < $1 >> ${root}_pngzop_brute.png
|
||||
shift
|
||||
done
|
||||
@@ -1,47 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# png_brute_zopfli.sh
|
||||
|
||||
# For use in the pngzop project
|
||||
# Copyright 2013 by Glenn Randers-Pehrson
|
||||
# Released under the pngcrush license (equivalent to the libpng license)
|
||||
|
||||
# Usage:
|
||||
# png_brute_zopfli.sh file.png [...]
|
||||
|
||||
# Input: *.png, a set of PNG files
|
||||
# Output: *.zlib, zopfli-compressed IDAT data
|
||||
|
||||
for x in $*
|
||||
do
|
||||
root=`echo $1 | sed -e "s/.png$//"`
|
||||
|
||||
# Generate trial PNGs with filter none, 4 PNG filters, and adaptive filter
|
||||
for f in 0 1 2 3 4 5
|
||||
do
|
||||
pngcrush -q -m 1 -f $f -force $1 ${root}_f$f.png &
|
||||
done
|
||||
wait
|
||||
|
||||
# Extract and decompress the zlib datastream from the concatenated IDAT chunks.
|
||||
for f in 0 1 2 3 4 5
|
||||
do
|
||||
pngzop_get_idat.exe < ${root}_f$f.png | zpipe -d > ${root}_f$f.idat &
|
||||
done
|
||||
wait
|
||||
rm -f ${root}_f?.png
|
||||
|
||||
# Recompress the IDAT data using zopfli
|
||||
for f in 0 1 2 3 4 5
|
||||
do
|
||||
zopfli --i25 --zlib ${root}_f$f.idat &
|
||||
done
|
||||
wait
|
||||
rm -f ${root}_f?.idat
|
||||
|
||||
# Copy the smallest result to file.zlib
|
||||
cat `pngzop_smallest.sh ${root}_f?.idat.zlib | tail -1` > ${root}.zlib
|
||||
rm -f ${root}_f?.idat.zlib
|
||||
|
||||
shift
|
||||
done
|
||||
@@ -1,22 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# png_get_idat.sh
|
||||
|
||||
# For use in the pngzop project
|
||||
# Copyright 2013 by Glenn Randers-Pehrson
|
||||
# Released under the pngcrush license (equivalent to the libpng license)
|
||||
|
||||
# Extracts and decompresses the data from the IDAT chunks in a set of
|
||||
# PNG files.
|
||||
|
||||
# Usage:
|
||||
# png_get_idat.sh file.png
|
||||
|
||||
# Output: file.idat
|
||||
|
||||
for x in $*
|
||||
do
|
||||
root=`echo $1 | sed -e "s/.png$//"`
|
||||
pngzop_get_idat.exe < $1 | zpipe -d > $root.idat
|
||||
shift
|
||||
done
|
||||
@@ -1,22 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# pngzop_get_zdat.sh
|
||||
|
||||
# For use in the pngzop project
|
||||
# Copyright 2013 by Glenn Randers-Pehrson
|
||||
# Released under the pngcrush license (equivalent to the libpng license)
|
||||
|
||||
# Extracts the concatenated data from the IDAT chunks in a set of PNG files,
|
||||
# leaving it compressed as found.
|
||||
|
||||
# Usage:
|
||||
# pngzop_get_zdat.sh file.png
|
||||
|
||||
# Output: file.zdat
|
||||
|
||||
for x in $*
|
||||
do
|
||||
root=`echo $1 | sed -e s/.png$//`
|
||||
pngzop_get_idat.exe < $1 > $root.zdat
|
||||
shift
|
||||
done
|
||||
@@ -1,28 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# pngzop_pngcrush.sh
|
||||
|
||||
# For use in the pngzop project
|
||||
# Copyright 2013 by Glenn Randers-Pehrson
|
||||
# Released under the pngcrush license (equivalent to the libpng license)
|
||||
|
||||
# Extracts the concatenated data from the IDAT chunks in a set of PNG files,
|
||||
# recompresses them with zopfli, and embeds them in a new set of PNG files
|
||||
# with suffix ".png" replaced with "_pngzop.png"
|
||||
|
||||
# Usage:
|
||||
# pngzop_pngcrush.sh *.png
|
||||
|
||||
# Standard Input: *.png
|
||||
# Output: *_pngzop.png
|
||||
|
||||
# To do: Adjust zlib CMF to reflect actual windowBits required.
|
||||
|
||||
for x in $*
|
||||
do
|
||||
root=`echo $1 | sed -e s/.png$//`
|
||||
pngzop_get_ihdr.exe < $1 > ${root}_pngzop.png
|
||||
pngzop_pngcrush_zopfli.sh $1 | pngzop_zlib_to_idat.exe >> ${root}_pngzop.png
|
||||
pngzop_get_iend.exe < $1 >> ${root}_pngzop.png
|
||||
shift
|
||||
done
|
||||
@@ -1,29 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# For use in the pngzop project
|
||||
# Copyright 2013 by Glenn Randers-Pehrson
|
||||
# Released under the pngcrush license (equivalent to the libpng license)
|
||||
|
||||
# Usage:
|
||||
# pngzop_pngcrush_zopfli.sh file.png > file.zlib
|
||||
|
||||
# file.png is a PNG file.
|
||||
# Standard output is the uncompressed IDAT chunk data, recompressed as a zlib
|
||||
# datastream.
|
||||
|
||||
root=`echo $1 | sed -e "s/.png$//"`
|
||||
rm -f ${root}_L9.png
|
||||
|
||||
# Do pngcrush level 9 with none, 4 filters, and adaptive filtering, and
|
||||
# select the smallest.
|
||||
pngcrush -q -m 113 -m 114 -m 115 -m 116 -m 117 -m 118 \
|
||||
-force $1 ${root}_L9.png
|
||||
|
||||
# Extract and decompress the zlib datastream from the concatenated IDAT chunks.
|
||||
pngzop_get_idat.exe < ${root}_L9.png | zpipe -d > ${root}_L9.idat
|
||||
rm ${root}_L9.png
|
||||
|
||||
# Recompress with zopfli and write it on standard output.
|
||||
zopfli --i25 --zlib -c ${root}_L9.idat
|
||||
|
||||
rm ${root}_L9.idat
|
||||
@@ -1,42 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# For use in the pngzop project
|
||||
# Copyright 2013 by Glenn Randers-Pehrson
|
||||
# Released under the pngcrush license (equivalent to the libpng license)
|
||||
|
||||
# Selects the smaller of file.zdat (extracted from a PNG) or
|
||||
# file.idat.zlib (same but recompressed with zopfli)
|
||||
|
||||
# picksmallest file1 file...
|
||||
|
||||
# for use on platforms that do not have "ls -S"
|
||||
|
||||
smallest=$1
|
||||
smallsize=`ls -l $1 | sed -e "
|
||||
s/[^ ]*[ ]*\
|
||||
[^ ]*[ ]*\
|
||||
[^ ]*[ ]*\
|
||||
[^ ]*[ ]*\
|
||||
//" -e "s/[ ].*//"`
|
||||
|
||||
shift
|
||||
|
||||
for x in $*
|
||||
do
|
||||
file=$1
|
||||
shift
|
||||
|
||||
size=`ls -l $file | sed -e "
|
||||
s/[^ ]*[ ]*\
|
||||
[^ ]*[ ]*\
|
||||
[^ ]*[ ]*\
|
||||
[^ ]*[ ]*\
|
||||
//" -e "s/[ ].*//"`
|
||||
|
||||
if [ $smallsize -gt $size ] ; then
|
||||
smallest=$file
|
||||
smallsize=$size
|
||||
fi
|
||||
done
|
||||
|
||||
echo $smallest
|
||||
Reference in New Issue
Block a user