Skip to content

Extend ScrollableImages to view tiffs#96

Merged
jacob720 merged 12 commits intomainfrom
jw/display-tiff
Aug 29, 2025
Merged

Extend ScrollableImages to view tiffs#96
jacob720 merged 12 commits intomainfrom
jw/display-tiff

Conversation

@jacob720
Copy link
Copy Markdown
Contributor

I've extended the ScrollableImages component so that it can handle multi-image tiffs. It will split the frames into seperate png images which can then be displayed by the browser.

@VictoriaBeilsten-Edmands
Copy link
Copy Markdown
Collaborator

There's a warning

Warning: Styled(div) contains an input of type number with both value and defaultValue props. Input elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props.

It's from having defaultValue and onChange here

        {renderNumbers && (
          <Box sx={{ display: "flex" }}>
            <Box
              data-testid="numeration"
              component="input"
              type="number"
              value={numberValue}
              defaultValue={""}
              onChange={handleNumberChange}
              onKeyDown={handleNumberEnter}

If it's controlled input you have value and onChange and if it's uncontrolled you have defaultValue but you can only have one or the other.

https://react.dev/reference/react-dom/components/input

@jacob720
Copy link
Copy Markdown
Contributor Author

Thanks, I've removed the defaultValue prop, as it should be a controlled input.

Copy link
Copy Markdown
Collaborator

@VictoriaBeilsten-Edmands VictoriaBeilsten-Edmands left a comment

Choose a reason for hiding this comment

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

Looks good. Just a minor point about function def.

Comment thread src/components/controls/ScrollableImages.tsx Outdated
@jacob720 jacob720 merged commit fc0ccf4 into main Aug 29, 2025
1 check passed
@jacob720 jacob720 deleted the jw/display-tiff branch August 29, 2025 13:03
VictoriaBeilsten-Edmands pushed a commit that referenced this pull request Sep 4, 2025
* View multi-page TIFFs in ScrollableImages

* Infer if image is tiff from url

* Allow .tif extension
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