[$175] Receipts are not showing fully when sent to [email protected]
If you haven’t already, check out our contributing guidelines for onboarding. To join our Slack channel, fill out this form.
Version Number: 9.5.10-0 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught during regression testing, add the test name, ID and link from BrowserStack: Email or phone of affected tester (no customers): Logs: https://stackoverflow.com/c/expensify/questions/4856 Expensify/Expensify Issue URL: Issue reported by: @Getrudygidashang Slack conversation (hyperlinked to channel name): #expensify_bugs
Action Performed:
Users forward the receipt to [email protected] using the email address associated with their Expensify account
Expected Result:
The receipt should be fully displayed when added directly to the expense.
Actual Result:
The receipt does not show fully displayed when added to users account.
Workaround:
Unknown
Platforms:
Select the officially supported platforms where the issue was reproduced:
- [ ] Android: App
- [ ] Android: mWeb Chrome
- [ ] iOS: App
- [ ] iOS: mWeb Safari
- [ ] iOS: mWeb Chrome
- [x] Windows: Chrome
- [ ] MacOS: Chrome / Safari
Screenshots/Videos
https://github.com/user-attachments/assets/3e7ac8a4-a591-4217-9ac0-db67325352dd
https://github.com/user-attachments/assets/debf8e26-4cbd-46e3-ac4e-cb2f4621d4af
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~022110793935688626891
- Upwork Job ID: 2110793935688626891
- Last Price Increase: 2026-10-15
Issue Owner
Current Issue Owner: @chuckdries
Proposal
⚠️ Medium confidence. I confirmed the cropping in code but couldn't watch the repro videos. Please check one thing first: open the receipt full screen. If the full-screen view is also cut off, the stored file is truncated by the backend and this App fix won't help.
What is the root cause of that problem?
Receipts sent by email are often very tall images, such as long HTML email bodies turned into a JPG. In the expense details view, the receipt preview is a fixed 16:9 box:
styles/index.ts:5470-5481sets the 16:9 box.MoneyRequestReceiptView.tsx:614-622applies it.
The image inside the box is drawn as a thumbnail, pinned to the top (ReceiptImage/index.tsx:214-232). No resize mode is passed, so it falls back to cover (ImageWithSizeCalculation.tsx:88). The image fills the box's width, and everything below the top part is cut off.
No recent PR introduced this; the preview has always cropped this way. Clicking the preview opens the full-screen viewer, which uses contain and shows the whole receipt.
What changes do you think we should make in order to solve the problem?
When the receipt shows in the fixed-size box, pass resizeMode contain to ThumbnailImage in ReceiptImage. Pass it from MoneyRequestReceiptView only for the non-fillSpace case, so other thumbnails stay the same. The whole receipt then fits in the box, with empty space at the sides.
This changes how the preview looks, so the design team should confirm it before we implement it.
What alternative solutions did you explore? (Optional)
- Treat it as expected behavior. The preview is a crop by design, and clicking it shows the full receipt.
- Size the box to the image's own aspect ratio, the way the wide receipt panel does (
flexibleHeight), with a maximum height. This shows more of the receipt but can make the right-hand panel very tall.
Investigation details
- The narrow preview loads the
.1024.jpgthumbnail (shouldUseThumbnailImage={!fillSpace}). The wide receipt panel (WideRHPReceiptPanel.tsx:95) uses the original image and its real aspect ratio, so it should show the full receipt. - For PDF receipts, the preview shows only page 1 (
ReportActionItemImage.tsx:206). If the forwarded email became a multi-page PDF, "not fully displayed" may mean the missing pages. - The full-screen viewer uses
contain(ImageView/index.tsx:123). - App doesn't size email receipts differently from other receipts. The backend turns the email into an image or PDF.
Questions for the reporter:
- Is the receipt also cut off in the full-screen view? If yes, the backend is producing a truncated file, and an internal engineer needs to investigate.
- Is the stored receipt a JPG or a multi-page PDF?
Possibly related: [Exploratory] Receipt is not fully visible, blank space appears on the report page
Next Steps for Contributor+ team:
To accept: @MelvinBot implement [this](https://github.com/Expensify/App/issues/104138) to create a draft PR.
To refine: @MelvinBot <your feedback>
To reject: Explain why you are rejecting Melvin's proposal.
Triggered auto assignment to Contributor-plus team member for initial proposal review - @sobitneupane (External)
Job added to Upwork: https://www.upwork.com/jobs/~022110793935688626891
Proposal
What is the root cause of that problem?
The receipt preview can crop tall images, including long receipts created from forwarded emails. When MoneyRequestReceiptView is not in fillSpace mode, it uses the fixed 16:9 expenseViewImage / expenseViewImageSmall styles (src/styles/index.ts). It then renders ReportActionItemImage with shouldUseThumbnailImage={!fillSpace}.
For ordinary receipt thumbnails, ReportActionItemImage renders ReceiptImage → ThumbnailImage without an explicit resize mode. The thumbnail defaults to cover and top positioning, so the preview only displays part of a tall image within that 16:9 viewport. The fullscreen image viewer uses contain instead.
One check before implementing: Please confirm whether the complete emailed receipt is visible in the fullscreen/expanded viewer. If the original is also truncated there, this is an email-import/backend issue, not a preview layout issue, and changing the thumbnail would hide the real problem.
What changes do you think we should make in order to solve the problem?
If the original receipt is complete and only the preview is cropped:
- Allow
ReportActionItemImageto pass an optional image resize mode through toReceiptImage/ThumbnailImage. - In the fixed-size expense receipt preview, use
containfor image receipts so the entire tall image fits inside the existing area. Keep the current behavior elsewhere, especially e-receipts, PDFs/page overlays, and full-height receipt views. - Add focused coverage for portrait and landscape receipt previews, and manually verify expanded/fullscreen display. Confirm the contained/letterboxed preview treatment with design before changing its appearance.
If fullscreen is also truncated, inspect the receipt generated by the forwarded-email pipeline first and keep the UI unchanged.
What alternative solutions did you explore? (Optional)
Growing the preview to the image's full aspect ratio would also reveal the whole receipt, but can make the details panel impractically tall. A scoped contain setting is smaller and safer if QA confirms this is only a preview problem.
Investigated with AI assistance; code paths reviewed, but I have not claimed to reproduce the forwarded-email case or run a UI test yet.
Contributor details Your Expensify account email: [email protected] Upwork Profile Link: https://www.upwork.com/freelancers/~0126a1db3ee4419254
Proposal
What is the root cause of that problem?
Forwarded email receipts (e.g. HTML order confirmations turned into images) often have very tall vertical aspect ratios (e.g., 1:3 or 1:4).
- In
src/components/ReportActionItem/MoneyRequestReceiptView.tsx(line 622), when!fillSpace(the standard expense preview in the right-hand panel), the preview container is constrained to a fixed 16:9 ratio viastyles.expenseViewImage/styles.expenseViewImageSmall. MoneyRequestReceiptViewrendersReportActionItemImage(line 791) withshouldUseThumbnailImage={!fillSpace}, butReportActionItemImagedoes not accept or forward an explicitresizeModeprop.- In
src/components/ReportActionItem/ReportActionItemImage.tsx(lines 199–232),propsObjpassed toReceiptImagedoes not includeresizeMode. - In
src/components/ReceiptImage/index.tsx(line 151),resizeModedefaults toundefinedand is forwarded toThumbnailImage(line 231) ->ImageWithSizeCalculation(line 160). - In
ImageWithSizeCalculation.tsx(line 88), whenresizeModeisundefined, it defaults to'cover'.
Because resizeMode="cover" is applied to a tall vertical image inside a fixed 16:9 container, the image expands to match the width and its entire bottom portion is cropped outside the viewport. When opening full-screen (ImageView), resizeMode="contain" is used, showing the full image.
What changes do you think we should make in order to solve the problem?
- In
src/components/ReportActionItem/ReportActionItemImage.tsx:- Extend
ReportActionItemImagePropsto accept an optionalresizeMode?: ImageProps['resizeMode']. - Forward
resizeModeintopropsObjacross the branches whereReceiptImageis constructed.
- Extend
diff --git a/src/components/ReportActionItem/ReportActionItemImage.tsx b/src/components/ReportActionItem/ReportActionItemImage.tsx
--- a/src/components/ReportActionItem/ReportActionItemImage.tsx
+++ b/src/components/ReportActionItem/ReportActionItemImage.tsx
@@ -69,6 +69,7 @@ type ReportActionItemImageProps = {
filename?: string;
+ resizeMode?: ImageProps['resizeMode'];
+
/** Whether the receipt is attached to a money request from the track expense flow */
@@ -208,6 +209,7 @@ function ReportActionItemImage({
fallbackIconSize: isSingleImage ? variables.iconSizeSuperLarge : variables.iconSizeExtraLarge,
isAuthTokenRequired: true,
+ resizeMode,
// If the image is full height, use initial position to make sure it will grow properly to fill the container
@@ -226,6 +228,7 @@ function ReportActionItemImage({
// If the image is full height, use initial position to make sure it will grow properly to fill the container
shouldUseInitialObjectPosition: isMapDistanceRequest && !shouldUseFullHeight,
isEmptyReceipt,
+ resizeMode,
onPress,
};
- In
src/components/ReportActionItem/MoneyRequestReceiptView.tsx:- Pass
resizeMode={!fillSpace ? 'contain' : undefined}to<ReportActionItemImage />(around line 791). - This ensures that when the receipt is displayed inside the fixed 16:9 thumbnail frame (
!fillSpace), the whole receipt is contained without being cropped. - For
fillSpace(wide receipt panel), it retains its current dynamic sizing behavior without letterboxing.
- Pass
diff --git a/src/components/ReportActionItem/MoneyRequestReceiptView.tsx b/src/components/ReportActionItem/MoneyRequestReceiptView.tsx
--- a/src/components/ReportActionItem/MoneyRequestReceiptView.tsx
+++ b/src/components/ReportActionItem/MoneyRequestReceiptView.tsx
@@ -790,6 +790,7 @@ function MoneyRequestReceiptView({
<>
<ReportActionItemImage
+ resizeMode={!fillSpace ? 'contain' : undefined}
shouldUseThumbnailImage={!fillSpace}
shouldUseFullHeight={fillSpace}
canZoomReceipt={canZoomReceipt}
- Verify edge cases:
- E-receipts and distance map receipts already have dedicated handling and will remain unaffected.
- PDF receipts: The first-page thumbnail will also scale cleanly without cropping the bottom of the invoice.
What alternative solutions did you explore? (Optional)
- Dynamically calculating preview height based on image aspect ratio: While this would eliminate letterboxing at the sides, email receipts can be 3000px+ tall, which would blow up the expense details panel layout. Using
resizeMode="contain"inside the existing bounded container is standard across the app, clean, and safe.
📣 @Metarenessans! 📣 Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork. Please follow these steps:
- Make sure you've read and understood the contributing guidelines.
- Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
- Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
- Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>
Contributor details Your Expensify account email: [email protected] Upwork Profile Link: https://www.upwork.com/freelancers/~0126a1db3ee4419254
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
Contributor details Your Expensify account email: [email protected] Upwork Profile Link: https://www.upwork.com/freelancers/~0163955a2ba22190aa
Proposal
Please re-state the problem that we are trying to solve in this issue.
When receipts are forwarded to [email protected] (such as tall, vertical order confirmations or invoice emails), the receipt preview in the expense details panel crops out the bottom half of the receipt. When tapping the receipt to open the full-screen modal, the complete receipt is visible.
What is the root cause of that problem?
- In
src/components/ReportActionItem/MoneyRequestReceiptView.tsx(line 755), when!fillSpace(standard expense preview in RHP), the receipt image sits in a fixed 16:9 container (styles.expenseViewImage/styles.expenseViewImageSmall). MoneyRequestReceiptViewdelegates rendering toReportActionItemImage. However,ReportActionItemImagePropsdoes not accept or pass aresizeModeprop.- In
src/components/ReportActionItem/ReportActionItemImage.tsx, the constructedpropsObjpassed toReceiptImagelacksresizeMode. - While
ReceiptImage(src/components/ReceiptImage/index.tsx, lines 119, 151, 231) already accepts and forwardsresizeModetoThumbnailImage/ImageWithSizeCalculation, omittingresizeModecausesImageWithSizeCalculation.tsx(line 88) to default to'cover'. - Because
resizeMode="cover"is applied to tall vertical email receipts inside a 16:9 container, the top of the receipt expands to fit the full width, causing the entire bottom section (line items, taxes, and total amounts) to be cropped out of view.
What changes do you think we should make in order to solve the problem?
-
In
src/components/ReportActionItem/ReportActionItemImage.tsx:- Add optional
resizeMode?: ReceiptImageProps['resizeMode'];toReportActionItemImageProps. - Forward
resizeModeintopropsObjacross the thumbnail/image branches.
- Add optional
-
In
src/components/ReportActionItem/MoneyRequestReceiptView.tsx:- Pass
resizeMode={!fillSpace ? 'contain' : undefined}to<ReportActionItemImage />. - When displayed inside the bounded 16:9 thumbnail frame (
!fillSpace), the whole receipt fits cleanly viacontainwithout cutting off bottom receipt details. - For
fillSpace(wide desktop view), it preserves full dynamic height without letterboxing.
- Pass
--- a/src/components/ReportActionItem/MoneyRequestReceiptView.tsx
+++ b/src/components/ReportActionItem/MoneyRequestReceiptView.tsx
@@ -753,6 +753,7 @@ function MoneyRequestReceiptView({
{({isHovering}) => (
<>
<ReportActionItemImage
+ resizeMode={!fillSpace ? 'contain' : undefined}
shouldUseThumbnailImage={!fillSpace}
shouldUseFullHeight={fillSpace}
canZoomReceipt={canZoomReceipt}
--- a/src/components/ReportActionItem/ReportActionItemImage.tsx
+++ b/src/components/ReportActionItem/ReportActionItemImage.tsx
@@ -98,6 +98,9 @@ type ReportActionItemImageProps = {
/** Whether the receipt can be hover-zoomed. When true, remote PDFs render the actual PDF on top of the thumbnail so magnification stays sharp (web only). */
canZoomReceipt?: boolean;
+ /** Resize mode for the receipt image */
+ resizeMode?: ReceiptImageProps['resizeMode'];
+
/** Callback to be called when the image loads */
onLoad?: (event?: {nativeEvent: {width: number; height: number}}) => void;
@@ -130,6 +133,7 @@ function ReportActionItemImage({
report: reportProp,
shouldUseThumbnailImage,
canZoomReceipt = false,
+ resizeMode,
onLoad,
onLoadFailure,
}: ReportActionItemImageProps) {
@@ -198,6 +202,7 @@ function ReportActionItemImage({
// If the image is full height, use initial position to make sure it will grow properly to fill the container
shouldUseInitialObjectPosition: isMapDistanceRequest && !shouldUseFullHeight,
+ resizeMode,
};
} else if (effectiveIsLocalFile && isPDF && typeof originalImageSource === 'string') {
propsObj = {isPDFThumbnail: true, source: originalImageSource};
@@ -214,6 +219,7 @@ function ReportActionItemImage({
// If the image is full height, use initial position to make sure it will grow properly to fill the container
shouldUseInitialObjectPosition: isMapDistanceRequest && !shouldUseFullHeight,
isEmptyReceipt,
+ resizeMode,
onPress,
};
}
Pre-coded and tested in branch: fix/104138-receipt-preview-resize-mode (https://github.com/jloa-dev/App/tree/fix/104138-receipt-preview-resize-mode).
What alternative solutions did you explore? (Optional)
Expanding the preview container's height to match the receipt's native aspect ratio. However, long email receipts can be 3000px+ high, which would distort the expense details screen and push all expense fields far below the fold. Using contain within the standard preview bounds cleanly displays the entire receipt while preserving the layout.
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
@sobitneupane Huh... This is 4 days overdue. Who can take care of this?
@sobitneupane Still overdue 6 days?! Let's take care of this!
I could not reproduce the issue.
I emailed receipt image to [email protected] and the image appeared as expected in the Expensify app.
@Getrudygidashang, am I missing any steps?
@sobitneupane this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!
@sobitneupane Whoops! This issue is 2 days overdue. Let's get this updated quick!
@sobitneupane 6 days overdue. This is scarier than being forced to listen to Vogon poetry!
@sobitneupane 6 days overdue. This is scarier than being forced to listen to Vogon poetry!
@sobitneupane Still overdue 6 days?! Let's take care of this!
I could not reproduce the issue.
I emailed receipt image to [email protected] and the image appeared as expected in the Expensify app.
@Getrudygidashang, am I missing any steps?
@sobitneupane Whoops! This issue is 2 days overdue. Let's get this updated quick!