Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better output new vips images as float32. #1016

Merged
merged 1 commit into from
Dec 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
### Changes
- Don't report filename in internal PIL metadata ([#1006](../../pull/1006))

### Bug Fixes
- Better output new vips images as float32 ([#1016](../../pull/1016))

## 1.18.0

### Features
Expand Down
5 changes: 4 additions & 1 deletion sources/vips/large_image_source_vips/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,8 +420,11 @@ def _outputToImage(self):
trunk = baseimg.copy()
branch = baseimg.copy()
for idx, entry in enumerate(self._output['images']):
entryimage = entry['image']
if img.format == 'float' and entry['image'].format == 'double':
entryimage = entryimage.cast(img.format)
branch = branch.composite(
entry['image'], pyvips.BlendMode.OVER, x=entry['x'], y=entry['y'])
entryimage, pyvips.BlendMode.OVER, x=entry['x'], y=entry['y'])
if not ((idx + 1) % leaves) or idx + 1 == len(self._output['images']):
trunk = trunk.composite(branch, pyvips.BlendMode.OVER, x=0, y=0)
branch = baseimg.copy()
Expand Down