App icon indicating copy to clipboard operation
App copied to clipboard

[HOLD for payment 2021-11-29] Small images are displayed HUGE on attachments preview

Open isagoico opened this issue 5 years ago • 16 comments

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:

  1. Copy this small image of a chilling cat with a sombrero image
  2. Send the image to any chat in New Expensify
  3. 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

image

Another example from @tgolen

image

Expensify/Expensify Issue URL:

Issue reported by: @tgolen Slack conversation: https://expensify.slack.com/archives/C01GTK53T8Q/p1635188881080800

View all open jobs on GitHub

isagoico avatar Oct 27 '21 03:10 isagoico

Triggered auto assignment to @deetergp (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.

MelvinBot avatar Oct 27 '21 03:10 MelvinBot

This definitely seems like something an external contractor could work on.

deetergp avatar Oct 29 '21 21:10 deetergp

Triggered auto assignment to @NicMendonca (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.

MelvinBot avatar Oct 29 '21 21:10 MelvinBot

Upwork job posting: https://www.upwork.com/jobs/~0140735bf8eaa08fea

NicMendonca avatar Nov 01 '21 12:11 NicMendonca

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"
/>

CamilaRivera avatar Nov 02 '21 06:11 CamilaRivera

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?

tgolen avatar Nov 02 '21 20:11 tgolen

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'}
/>

CamilaRivera avatar Nov 03 '21 02:11 CamilaRivera

Ah, cool. Thanks for checking that! The proposal looks good so I give the 🟢 for you to be hired on UpWork for this.

tgolen avatar Nov 03 '21 16:11 tgolen

@CamilaRivera hired!

NicMendonca avatar Nov 03 '21 16:11 NicMendonca

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.

mallenexpensify avatar Nov 08 '21 17:11 mallenexpensify

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!

CamilaRivera avatar Nov 09 '21 05:11 CamilaRivera

Relax Melvin, this is not overdue.

deetergp avatar Nov 11 '21 19:11 deetergp

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:

botify avatar Nov 22 '21 19:11 botify

@CamilaRivera sorry for the delay! I have just issued payment and company offsite bonus.

NicMendonca avatar Dec 01 '21 14:12 NicMendonca

@NicMendonca Just a question. The PR for this issue was merged before the company offsite hold started. Does this qualify for a bonus?

parasharrajat avatar Dec 01 '21 15:12 parasharrajat

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.

NicMendonca avatar Dec 01 '21 15:12 NicMendonca