[HOLD for payment 2021-11-29] Small images are displayed HUGE on attachments preview
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Action Performed:
- Copy this small image of a chilling cat with a sombrero

- Send the image to any chat in New Expensify
- Check the image preview
Expected Result:
Image should be displayed with a size that matches the real image size
Actual Result:
Image is displayed huge. (Please compare the image size how it's rendered in GH and in New Expensify)
Workaround:
None needed, visual issue.
Platform:
Where is this issue occurring?
- Web
- iOS
- Android
- Desktop App
- Mobile Web
Version Number: 1.1.10-0
Reproducible in staging?: Yes Reproducible in production?: Yes
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation

Another example from @tgolen

Expensify/Expensify Issue URL:
Issue reported by: @tgolen Slack conversation: https://expensify.slack.com/archives/C01GTK53T8Q/p1635188881080800
Triggered auto assignment to @deetergp (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.
This definitely seems like something an external contractor could work on.
Triggered auto assignment to @NicMendonca (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.
Upwork job posting: https://www.upwork.com/jobs/~0140735bf8eaa08fea
Proposal
We can change the prop value for resizeMode from contain to center in the Image component. This change will "Center the image in the view along both dimensions. If the image is larger than the view, scale it down uniformly so that it is contained in the view." (https://reactnative.dev/docs/image#resizemode)
The changes should be done in this line: https://github.com/Expensify/App/blob/d7a77751fe4e4563094e8650972beb59ad71d27d/src/components/ImageView/index.js#L213-L217
like this:
<Image
source={{uri: this.props.url}}
style={getZoomSizingStyle(this.state.isZoomed, this.state.imgWidth, this.state.imgHeight, this.state.zoomScale)}
resizeMode="center"
/>
Thanks, @CamilaRivera! Could you please take a look at the blame for that line and see why it was added as "center" and make sure this wouldn't cause any regressions?
Thanks, @CamilaRivera! Could you please take a look at the blame for that line and see why it was added as "center" and make sure this wouldn't cause any regressions?
Thanks, @tgolen! I was indeed breaking it when the image was zoomed in, so for avoiding that I need to check first the state isZoomed. If is zoomed I will keep the resizeMode to contain but if is its original size it should be center. The proposal would be the following one:
Proposal
<Image
source={{uri: this.props.url}}
style={getZoomSizingStyle(this.state.isZoomed, this.state.imgWidth, this.state.imgHeight, this.state.zoomScale)}
resizeMode={this.state.isZoomed ? 'contain' : 'center'}
/>
Ah, cool. Thanks for checking that! The proposal looks good so I give the 🟢 for you to be hired on UpWork for this.
@CamilaRivera hired!
We are placing all non-critical issues on hold while we're on a company offsite. The hold is expected to be lifted on 11/19 (but could go longer). For any PRs that are submitted before or during the hold, we will add a $250 bonus payment.
We are placing all non-critical issues on hold while we're on a company offsite. The hold is expected to be lifted on 11/19 (but could go longer). For any PRs that are submitted before or during the hold, we will add a $250 bonus payment.
Understood, thanks!
Relax Melvin, this is not overdue.
The solution for this issue has been :rocket: deployed to production :rocket: in version 1.1.15-15 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:
- https://github.com/Expensify/App/pull/6206
If no regressions arise, payment will be issued on 2021-11-29. :confetti_ball:
@CamilaRivera sorry for the delay! I have just issued payment and company offsite bonus.
@NicMendonca Just a question. The PR for this issue was merged before the company offsite hold started. Does this qualify for a bonus?
We are placing all non-critical issues on hold while we're on a company offsite. The hold is expected to be lifted on 11/19 (but could go longer). For any PRs that are submitted before or during the hold, we will add a $250 bonus payment.
☝️ Didn't specify, just said "submitted". It was merged, but wasn't deployed. Payment has already been issued.