Skip to content

Conversation

@annehaley
Copy link
Collaborator

@annehaley annehaley commented Oct 16, 2025

When using django-large-image to get tiles from a multiframe image, the frame value should be passed to the getTile call, not just the style. This PR makes a small change to ensure that any frame value passed to the style will also get passed to the getTile call.

To illustrate the difference in behavior, an example multiframe geospatial image (download here) has transparency applied to nodata values.

import large_image

path = 'flood_transparency_test.tif'
projection = 'epsg:3857'
tile_params = dict(x=619, y=757, z=11)
style = dict(palette='viridis', nodata=-1, min=0, max=1)
frame = 5

The following images are examples of the difference between passing frame as a tile param versus a style param.

As a tile param:

src = large_image.open(path, projection=projection, style=style, encoding='PNG')
tile = src.getTile(**tile_params, frame=frame)
tile_test_1

As a style param:

style['frame'] = frame
src = large_image.open(path, projection=projection, style=style, encoding='PNG')
tile = src.getTile(**tile_params)
tile_test_2

When frame is only expressed via style, the transparency mask applied to the tile will belong to the first frame but visible values will belong to the specified frame.

@codecov
Copy link

codecov bot commented Oct 17, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.60%. Comparing base (50cf80f) to head (0396748).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #56      +/-   ##
==========================================
+ Coverage   95.58%   95.60%   +0.01%     
==========================================
  Files          16       16              
  Lines         679      682       +3     
==========================================
+ Hits          649      652       +3     
  Misses         30       30              
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@annehaley annehaley changed the base branch from main to fix-ci October 17, 2025 15:15
@brianhelba brianhelba removed their request for review October 17, 2025 18:38
Base automatically changed from fix-ci to main October 20, 2025 16:28
@annehaley annehaley merged commit dcc1215 into main Oct 20, 2025
8 of 9 checks passed
@annehaley annehaley deleted the frame-tile-param branch October 20, 2025 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants