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): blob fails to read WebP image info #13069

Merged
merged 4 commits into from Oct 20, 2021

Conversation

jquick-axway
Copy link
Contributor

JIRA:
https://jira.appcelerator.org/browse/TIMOB-28535

Summary:

  • When loading a WebP image via a Ti.Blob then its width/height and mimeType properties return the wrong values and the blob's image*() methods wrongly return null.
  • Caused by Java URLConnection.guessContentTypeFromStream() method which wrongly returned "audio/x-wav" instead of "image/webp", which caused the blob to think it wasn't an image.

Test:

  1. Copy "TiLogoOpaque.webp" from TIMOB-28535 to project folder: ./Resources/assets/images
  2. Use "app.js" code shown in ticket TIMOB-28535.
  3. Build and run on Android.
  4. Verify a red Titanium logo with rounded corners appears in app. (Use to show nothing.)
  5. Verify app's "Image Size" label reads: 1024x1024
  6. Verify app's "Mime-Type" label reads: image/webp

@jquick-axway jquick-axway added this to the 10.2.0 milestone Sep 15, 2021
@build build requested a review from a team September 16, 2021 00:01
@build
Copy link
Contributor

build commented Sep 16, 2021

Warnings
⚠️ Tests have failed, see below for more information.
Messages
📖 ✊ The commits in this PR match our conventions! Feel free to Rebase and Merge this PR when ready.
📖 ❌ 1 tests have failed There are 1 tests failing and 1158 skipped out of 21062 total tests.
📖

💾 Here's the generated SDK zipfile.

Tests:

ClassnameNameTimeError
android.emulator.main.Titanium.Geolocation.methods#forwardGeocoder() works via callback argument (12)5.026
Error: expected false to be true
at Assertion.fail (/node_modules/should/cjs/should.js:275:13)
      at Assertion.value (/node_modules/should/cjs/should.js:356:9)
      at Geolocation.<anonymous> (/ti.geolocation.test.js:585:32)

Generated by 🚫 dangerJS against 5202b24

@garymathews
Copy link
Contributor

@jquick-axway Looks like .image with Ti.Blob WebP test is failing on Android 5.0

@jquick-axway
Copy link
Contributor Author

@garymathews , the WebP image loads fine on Android 5.0, but the window's "postlayout" event was happening before the ImageView resized itself to fit its image. I re-worked the event handling to make the unit test more reliable.

Copy link
Contributor

@garymathews garymathews left a comment

Choose a reason for hiding this comment

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

CR: PASS

@jquick-axway jquick-axway merged commit acc561a into tidev:master Oct 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants