Permalink
Browse files

Corrected adjusted image file naming. Fixes #40.

  • Loading branch information...
1 parent 8cfb104 commit 7571de3406a3aaff60f217236ed6754e671011c0 @melinath melinath committed Mar 14, 2013
Showing with 3 additions and 1 deletion.
  1. +2 −0 daguerre/tests/unit/test_adjustments.py
  2. +1 −1 daguerre/utils/adjustments.py
@@ -122,6 +122,8 @@ def test_adjust_crop__50x100(self):
with self.assertNumQueries(4):
adjusted = AdjustmentHelper(self.base_image, width=50, height=100, adjustment='crop').adjust()
self.assertImageEqual(Image.open(adjusted.adjusted.path), expected)
+ # Make sure that the path is properly formatted.
+ self.assertTrue(adjusted.adjusted.path.endswith('.png'))
def test_adjust_crop__100x50(self):
expected = Image.open(self._data_path('100x50_crop.png'))
@@ -465,7 +465,7 @@ def adjust(self):
format = adjustment.format if adjustment.format in KEEP_FORMATS else DEFAULT_FORMAT
args = (unicode(creation_kwargs), datetime.datetime.now().isoformat())
- filename = ''.join((make_hash(*args, step=2), format.lower()))
+ filename = '.'.join((make_hash(*args, step=2), format.lower()))
storage_path = f.generate_filename(adjusted, filename)
final_path = save_image(im, storage_path, format=format, storage=default_storage)

0 comments on commit 7571de3

Please sign in to comment.