aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/rewritejpeg
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/rewritejpeg')
-rwxr-xr-xscripts/rewritejpeg29
1 files changed, 29 insertions, 0 deletions
diff --git a/scripts/rewritejpeg b/scripts/rewritejpeg
new file mode 100755
index 0000000..b2e36ea
--- /dev/null
+++ b/scripts/rewritejpeg
@@ -0,0 +1,29 @@
+#!/bin/bash
+# -*- Mode: shell-script -*-
+# Copyright (C) 2002 by Chmouel Boudjnah <chmouel@mandrakesoft.com>
+# Redistribution of this file is permitted under the terms of the GNU
+# Public License (GPL)
+#
+# Take a Jpeg and reconvert it via ppm-tools to make sure is
+# compatible for boot logo
+# $Id$
+
+files="$@"
+
+[[ -z $files ]] && {
+ echo "I need jpeg files argument"
+ exit 1
+}
+
+for file in $files;do
+ [[ $file != *.jpg ]] && {
+ echo "$file is not a jpeg"
+ continue;
+ }
+ echo "Converting $file"
+ tmp=${file/.jpg/.ppm}
+ jpegtopnm $file > $tmp
+ ppmtojpeg $tmp > $file
+ rm -f $tmp
+done
+