Skip to content

Test opening single-channel OME-TIFF file #102

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Test opening single-channel OME-TIFF file #102

wants to merge 2 commits into from

Conversation

weiji14
Copy link
Member

@weiji14 weiji14 commented May 21, 2025

What I am changing

  • Ensure that a single-channel OME-TIFF files can be opened by async-tiff

How I did it

How you can test it

  • Run cargo test locally or look at CI logs

Related Issues

@kylebarron
Copy link
Member

Does this close #101?

#[tokio::test]
async fn test_ome_tiff_single_channel() {
let tiff =
util::open_remote_tiff("https://downloads.openmicroscopy.org/images/OME-TIFF/2016-06/bioformats-artificial/single-channel.ome.tif").await;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah I think it would be better to either check in this file into this repo, or perhaps create an async-tiff-fixtures separate repo that we can check data into.

Assuming this file is large, it would be great if we could extract like a one-pixel or very small subset of this file, while maintaining all header metadata the same.

Or, we could find the size of the last IFD and just clip the existing buffer to that region. So all IFD parsing would succeed but any image loading would fail as the image data is past the byte region checked in to the test fixture.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is 74.3KB, not huge but having many test files like these will add up (the vendored images from #28 add up to 4.5MB already 🙂).

Probably best to bring this discussion over to #23.

@weiji14
Copy link
Member Author

weiji14 commented Jun 3, 2025

Does this close #101?

No it doesn't. I haven't applied the String::from_utf8_lossy patch mentioned at #101 (comment), nor handled the line causing the panic on the pyo3 side yet. Will do that in another PR.

@weiji14 weiji14 marked this pull request as ready for review June 3, 2025 01:47
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.

2 participants