Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(android): bundle webp res files #14047

Merged
merged 6 commits into from
Jun 15, 2024
Merged

fix(android): bundle webp res files #14047

merged 6 commits into from
Jun 15, 2024

Conversation

m1ga
Copy link
Contributor

@m1ga m1ga commented May 25, 2024

looks like there is a file that collects all image types in the build process and webp was not an option in there :) Downside: if you use assets/android/images/res-xxxhdpi/ with a webp file it won't include that.

Using Android Studio you can see that it only includes res files for JPG images (or PNG):
Screenshot_20240525_143556
the webp file doesn't have dpi folders.

With this PR:
Screenshot_20240525_144917

Tests
I've also added a visual test with /res files. Currently only for a xxhdpi emulator. I had to downgrade strip-ansi again as that version was an ESM version and the tests wouldn't open. 6.0.1 is the last non ESM version for now

@m1ga
Copy link
Contributor Author

m1ga commented May 25, 2024

Test:

const win = Ti.UI.createWindow();
var img = Ti.UI.createImageView({
	image: "/images/image.webp"
});
win.add(img);
win.open();

download this ZIP and extract it into /app/assets/
android.zip
and run the app. It should show the image and e.g. XX or XXX in the image.

@m1ga m1ga marked this pull request as draft May 25, 2024 15:21
@m1ga m1ga marked this pull request as ready for review May 25, 2024 16:10
@m1ga m1ga added bug test PR that updates our test cases labels May 25, 2024
@@ -157,7 +157,7 @@
"rollup": "2.76.0",
"ssri": "10.0.4",
"stream-splitter": "0.3.2",
"strip-ansi": "7.1.0",
"strip-ansi": "6.0.1",
Copy link
Collaborator

@hansemannn hansemannn May 27, 2024

Choose a reason for hiding this comment

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

Why did we need to downgrade here? If it's the ESM issue, I wonder why it worked before, as there were no ESM related changes between 12_3_X and master.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it looks like strip-ansi is only used in npm run test the rest worked fine and the github action doesn't run the tests and I only tested apps and modules after updating the package.json the last time.

I can remove the test for now so it will only be the one webp line and can add the test with the downgrade later

@hansemannn hansemannn merged commit 6552a2c into master Jun 15, 2024
5 checks passed
@m1ga m1ga deleted the androidWebp branch June 15, 2024 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug test PR that updates our test cases
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants