added gzip func to pngizer

This commit is contained in:
Luxferre
2026-02-13 11:14:35 +02:00
parent 03583f96ef
commit 5f2e2922ac
+3 -3
View File
@@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
# PNGizer: convert any file into PNG image and back # PNGizer: convert any file into PNG image and back
# Depends on mktemp, tar, ImageMagick and pngcrush # Depends on mktemp, tar, gzip, ImageMagick and pngcrush
# Created by Luxferre in 2026, released into public domain # Created by Luxferre in 2026, released into public domain
# Convert any raw data file to PNG # Convert any raw data file to PNG
@@ -43,7 +43,7 @@ pngize() {
[ -z "$2" ] && ofile="$1.png" [ -z "$2" ] && ofile="$1.png"
temp_arch="$(mktemp)" temp_arch="$(mktemp)"
# containerize the input # containerize the input
tar cf $temp_arch "$1" GZIP=-9 tar czvf $temp_arch "$1"
# run the conversion # run the conversion
pngize_raw $temp_arch $ofile pngize_raw $temp_arch $ofile
rm -f $temp_arch rm -f $temp_arch
@@ -55,7 +55,7 @@ pngize() {
unpngize() { unpngize() {
temp_arch="$(mktemp)" temp_arch="$(mktemp)"
unpngize_raw "$1" $temp_arch unpngize_raw "$1" $temp_arch
tar xf $temp_arch gzip -dcq $temp_arch | tar xvf -
rm -f $temp_arch rm -f $temp_arch
} }