Skip to content

fix(jpeg): android jpeg drawable resources - #1480

Merged
dannyhw merged 1 commit into
callstack:mainfrom
CristiCeban:fix/android-jpeg-drawable-resources
Oct 9, 2026
Merged

dannyhw merged 1 commit into
callstack:mainfrom
CristiCeban:fix/android-jpeg-drawable-resources

Conversation

@CristiCeban

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #1479. In Android release builds, .jpeg images don't show: <Image source={require('./photo.jpeg')} /> renders empty, while the same file renamed to .jpg works.

Re.Pack's assets loader only sends png|jpg|gif|webp to drawable-*, so .jpeg ends up in raw. React Native looks up jpeg as a drawable (drawableFileTypes in @react-native/asset-utils), so it can't find the image.

This PR makes the loader's image list match React Native's drawableFileTypes (gif|heic|heif|jpeg|jpg|ktx|png|webp; xml is still handled separately). It also updates the Android resource directories table in the Assets loader docs.

Test plan

  • New integration test checks Android placement per image type: png, jpg, jpeg, gif, webp → drawable-mdpi; bmp, svg → raw. Before the fix, only jpeg failed (rspack and webpack).
  • tests/integration (140) and packages/repack unit tests (347) pass; pnpm lint:ci is clean.
  • Manually on an RN 0.87.1 app, Android release build (minifyEnabled + shrinkResources) on an emulator:
    • Before: the .jpeg was packaged under raw/ and the <Image> rendered empty.
    • After: it's under drawable/ and renders next to .jpg and .png.
Before After
jpeg-before-crop jpeg-after-crop
.jpeg packaged under raw/, <Image> renders empty .jpeg packaged under drawable/, renders like .jpg and .png

@vercel

vercel Bot commented Oct 9, 2026

Copy link
Copy Markdown

@CristiCeban is attempting to deploy a commit to the Callstack Team on Vercel.

A member of the Team first needs to authorize it.

@changeset-bot

changeset-bot Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 81b4e8f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 6 packages
Name Type
@callstack/repack Patch
@callstack/repack-plugin-expo-modules Patch
@callstack/repack-plugin-nativewind Patch
@callstack/repack-plugin-reanimated Patch
@callstack/repack-dev-server Patch
@callstack/repack-init Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@CristiCeban
CristiCeban force-pushed the fix/android-jpeg-drawable-resources branch from 6cbb2eb to 6fd2fed Compare October 9, 2026 08:47
@CristiCeban
CristiCeban force-pushed the fix/android-jpeg-drawable-resources branch from 6fd2fed to 81b4e8f Compare October 9, 2026 08:50
@dannyhw
dannyhw merged commit 166388b into callstack:main Oct 9, 2026
3 of 4 checks passed
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