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

Gif Not Working #83

Closed
kmnaseef opened this issue Apr 22, 2024 · 5 comments
Closed

Gif Not Working #83

kmnaseef opened this issue Apr 22, 2024 · 5 comments
Assignees

Comments

@kmnaseef
Copy link

kmnaseef commented Apr 22, 2024

thallu-nuna

Coil AsyncImage() can display this image, but ZoomableAsyncImage() cannot. please check.
ImageDecoderDecoder.Factory() component added in both cases.

saket added a commit that referenced this issue Apr 22, 2024
@saket
Copy link
Owner

saket commented Apr 22, 2024

I'm sorry, but I can't help you investigate the problem without any code. Can you share a reproducer? A branch with telephoto's sample app would be the best.

@kmnaseef
Copy link
Author

kmnaseef commented Apr 23, 2024

My Application.zip
Screenshot 2024-04-23 135147

issue: ZoomableAsyncImage cannot display an image that can do with Coil AsyncImage.

what I did:

  1. Created a new project
  2. added dependancy implementation("me.saket.telephoto:zoomable-image-coil:0.10.0")
  3. added an image into assets folder
  4. added a zoomableAsyncImage(green border in picture) and an asyncImage into compose(red border)
  5. .Run

Note: NOT added implementation("io.coil-kt:coil-gif:2.5.0"). there is no difference if added. AsyncImage displaying even this not added

@saket
Copy link
Owner

saket commented Apr 26, 2024

This is very interesting. thallu.gif is a single-frame GIF. telephoto is failing to display it because,

  1. Your project isn't using Coil's GIF decoder. If you use GifDecoder, the image will be shown correctly.

  2. If you use ImageDecoderDecoder, which coil suggests using on API 28+, Android will read the GIF as a bitmap instead of an animated drawable because there is no animation needed for a single frame. This is confusing for telephoto because it tries to sub-sample this bitmap and fails when BitmapRegionDecoder refuses to decode a GIF.

I'm thinking I'll have to solve this by manually checking if an image is a GIF here:

internal suspend fun SubSamplingImageSource.canBeSubSampled(): Boolean {

@saket saket self-assigned this Apr 26, 2024
saket added a commit that referenced this issue Apr 26, 2024
@saket saket closed this as completed in 483bf05 Apr 26, 2024
@saket
Copy link
Owner

saket commented Apr 26, 2024

Please do! I'll make a release soon, but you can use 0.11.0-SNAPSHOT in the meantime.

@kmnaseef
Copy link
Author

Yea, Its Working.. Thank you.

github-merge-queue bot pushed a commit to slackhq/circuit that referenced this issue Apr 28, 2024
…1373)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
|
[me.saket.telephoto:zoomable-image-coil](https://togithub.com/saket/telephoto)
| dependencies | minor | `0.10.0` -> `0.11.2` |

---

> [!WARNING]
> Some dependencies could not be looked up. Check the Dependency
Dashboard for more information.

---

### Release Notes

<details>
<summary>saket/telephoto
(me.saket.telephoto:zoomable-image-coil)</summary>

###
[`v0.11.2`](https://togithub.com/saket/telephoto/releases/tag/0.11.2)

Bug fixes

-
[saket/telephoto#84:
Fixed an issue causing placeholders to sometimes take up the full screen
(by [@&#8203;rharter](https://togithub.com/rharter))
-
[saket/telephoto#37:
Prevent a crash in `ZoomableAsyncImage()` after the app's disk cache is
cleared
-
[saket/telephoto#83:
Correctly display single-frame GIFs

New changes

- Increase memory cache hit rate with Coil by using `Precision.INEXACT`

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Renovate
Bot](https://togithub.com/renovatebot/renovate).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zMjYuMiIsInVwZGF0ZWRJblZlciI6IjM3LjMyNi4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->
ZacSweers pushed a commit to ZacSweers/CatchUp that referenced this issue Apr 29, 2024
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
|
[me.saket.telephoto:zoomable-image-coil](https://togithub.com/saket/telephoto)
| `0.10.0` -> `0.11.2` |
[![age](https://developer.mend.io/api/mc/badges/age/maven/me.saket.telephoto:zoomable-image-coil/0.11.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/me.saket.telephoto:zoomable-image-coil/0.11.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/me.saket.telephoto:zoomable-image-coil/0.10.0/0.11.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/me.saket.telephoto:zoomable-image-coil/0.10.0/0.11.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
|
[me.saket.telephoto:zoomable-image](https://togithub.com/saket/telephoto)
| `0.10.0` -> `0.11.2` |
[![age](https://developer.mend.io/api/mc/badges/age/maven/me.saket.telephoto:zoomable-image/0.11.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/me.saket.telephoto:zoomable-image/0.11.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/me.saket.telephoto:zoomable-image/0.10.0/0.11.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/me.saket.telephoto:zoomable-image/0.10.0/0.11.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
| [me.saket.telephoto:zoomable](https://togithub.com/saket/telephoto) |
`0.10.0` -> `0.11.2` |
[![age](https://developer.mend.io/api/mc/badges/age/maven/me.saket.telephoto:zoomable/0.11.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/me.saket.telephoto:zoomable/0.11.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/me.saket.telephoto:zoomable/0.10.0/0.11.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/me.saket.telephoto:zoomable/0.10.0/0.11.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>saket/telephoto
(me.saket.telephoto:zoomable-image-coil)</summary>

###
[`v0.11.2`](https://togithub.com/saket/telephoto/releases/tag/0.11.2)

Bug fixes

-
[saket/telephoto#84:
Fixed an issue causing placeholders to sometimes take up the full screen
(by [@&#8203;rharter](https://togithub.com/rharter))
-
[saket/telephoto#37:
Prevent a crash in `ZoomableAsyncImage()` after the app's disk cache is
cleared
-
[saket/telephoto#83:
Correctly display single-frame GIFs

New changes

- Increase memory cache hit rate with Coil by using `Precision.INEXACT`

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about these
updates again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/ZacSweers/CatchUp).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zMjEuMiIsInVwZGF0ZWRJblZlciI6IjM3LjMyMS4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
ibabuk added a commit to ibabuk/telephoto that referenced this issue May 24, 2024
* trunk: (45 commits)
  Prepare next development version
  Prepare to release v0.11.2
  Reload images using coil only once
  Revert the version to 0.10.0 on project website
  Set coil's precision to INEXACT only if it wasn't explicitly set
  Abort v0.11.0's release
  Prepare to release v0.11.0
  Re-enable death penalty for leaking closable object violations
  Fix typos in SubSamplingImageSource#canBeSubSampled()
  Fix a DiskReadViolation when reading file headers
  Reload an image if its deleted from disk cache
  Add a failing test for saket#37
  Increase memory cache hit rate with Coil
  Fail fast if screenshot tests are run on an incompatible device
  Move the test for async placeholders to ZoomableImageTest
  Add a test to verify single-frame GIFs with glide
  Prevent sub-sampling of single-frame GIFs
  Add a failing test to reproduce saket#83
  Updates test to use existing imagery.
  Updates test name
  ...

# Conflicts:
#	gradle/libs.versions.toml
#	test-util/src/main/kotlin/me/saket/telephoto/util/prepareActivity.kt
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

No branches or pull requests

2 participants