Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Corrected adjusted image file naming. Fixes #40.

  • Loading branch information...
commit 7571de3406a3aaff60f217236ed6754e671011c0 1 parent 8cfb104
@melinath melinath authored
View
2  daguerre/tests/unit/test_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'))
View
2  daguerre/utils/adjustments.py
@@ -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)
Please sign in to comment.
Something went wrong with that request. Please try again.