diff -Naur spritegen-0.1a1/includes/css-sprite-gen.inc.php spritegen/includes/css-sprite-gen.inc.php --- spritegen-0.1a1/includes/css-sprite-gen.inc.php 2008-01-26 06:25:19.000000000 -0500 +++ spritegen/includes/css-sprite-gen.inc.php 2008-02-23 16:52:07.000000000 -0500 @@ -64,6 +64,7 @@ } public function ProcessForm() { + require('validation.inc.php'); $aFieldsToIgnore = array( @@ -77,7 +78,8 @@ 'classpre', 'tagspost', 'fileregex', - 'use-transparency' + 'use-transparency', + 'use-checksum' ); $aRules = array( @@ -287,12 +289,20 @@ if (!is_dir(SPRITE_DIR)) { mkdir(SPRITE_DIR); } - + $sOutputFormat = strtolower($this->aFormValues['imageoutput']); + $this->bChecksum = !empty($this->aFormValues['use-checksum']); + $this->sTempSpriteName = SPRITE_DIR.uniqid('csg-').".$sOutputFormat"; $this->WriteImage($oSprite, $sOutputFormat, $this->sTempSpriteName); imagedestroy($oSprite); + if ($this->bChecksum) { + $newName = SPRITE_DIR . 'csg-' . hash_file('md5', $this->sTempSpriteName) . ".$sOutputFormat"; + rename($this->sTempSpriteName, $newName); + $this->sTempSpriteName = $newName; + } + $this->bValidImages = true; } } diff -Naur spritegen-0.1a1/templates/home.php spritegen/templates/home.php --- spritegen-0.1a1/templates/home.php 2008-01-26 06:25:19.000000000 -0500 +++ spritegen/templates/home.php 2008-02-23 17:07:01.000000000 -0500 @@ -63,8 +63,9 @@ TextInput('bckground', $translation->Get('form.label.background-colour'), '', 7, $translation->Get('form.hint.transparency'), true); ?> > + > - SelectInput('imageoutput', $translation->Get('form.label.sprite-output-format'), $imageTypes, '', ''); ?> + SelectInput('imageoutput', $translation->Get('form.label.sprite-output-format'), $imageTypes, '', ''); ?>
Get('form.legend.css-output-options'); ?> diff -Naur spritegen-0.1a1/translations/en.txt spritegen/translations/en.txt --- spritegen-0.1a1/translations/en.txt 2008-01-26 06:25:19.000000000 -0500 +++ spritegen/translations/en.txt 2008-02-23 15:48:27.000000000 -0500 @@ -31,6 +31,7 @@ form.label.vertical-offset = Vertical Offset form.label.background-colour = Background / Transparency Colour \# (optional) form.label.use-transparency = Use Background Colour for Transparency +form.label.use-checksum = Use Checksum of Contents in Filename form.label.sprite-output-format = Sprite Output Format form.label.css-prefix = CSS Prefix (optional) form.label.filename-pattern-match = Filename Pattern Match (optional)