Skip to content

Commit

Permalink
Merge pull request #124 from ASFHyP3/release
Browse files Browse the repository at this point in the history
Release: thumbnail filename fix
  • Loading branch information
asjohnston-asf authored Jul 15, 2020
2 parents 2a019d4 + 22fed22 commit 5d61850
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [PEP 440](https://www.python.org/dev/peps/pep-0440/)
and uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2.0.6](https://github.com/ASFHyP3/hyp3-rtc-gamma/compare/v2.0.5...v2.0.6)

### Fixed
* Resolved issue where thumbnail filenames ended in ..png rather than .png

## [2.0.5](https://github.com/ASFHyP3/hyp3-rtc-gamma/compare/v2.0.4...v2.0.5)

### Added
Expand Down
2 changes: 1 addition & 1 deletion hyp3_rtc_gamma/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def download_file(url, retries=3, backoff_factor=10, chunk_size=5242880):

def create_thumbnail(input_image, size=(100, 100)):
filename, ext = os.path.splitext(input_image)
thumbnail_name = f'{filename}_thumb.{ext}'
thumbnail_name = f'{filename}_thumb{ext}'

output_image = Image.open(input_image)
output_image.thumbnail(size)
Expand Down
1 change: 1 addition & 0 deletions tests/test_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ def test_create_thumbnail(image):
assert input_image.size == (162, 150)

thumbnail = main.create_thumbnail(image, (100, 100))
assert os.path.basename(thumbnail) == 'test_thumb.png'

with Image.open(image) as input_image:
assert input_image.size == (162, 150)
Expand Down

0 comments on commit 5d61850

Please sign in to comment.