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

Encode gif if CameraMode is set to GIF #159

Merged
merged 6 commits into from
Jun 2, 2023

Conversation

Deco354
Copy link
Collaborator

@Deco354 Deco354 commented May 31, 2023

What it does

GIFs sometimes aren't encoded when the CameraMode is set to gif. This is as there's a settings.feature.gifs flag we check that determines if gifs should be enabled.

It's possible to use the API to trigger a CameraViewController on gif mode without having this feature on. This is a bug in itself but for the time being this PR ensures that if a user has selected the gif camera and taken a photo we always encode that gif. Prior to now the gif was coming out as a video.

I've made this function testable and added a test. The commit with the actual functionality change is below:
The fix commit

How to test

Use a real device for both tests

Example project

  • Load the example project on to a real device
  • Disable gif support
  • Change the camera to gif mode
  • Take a photo and post
  • You should be brought back to the dashboard
  • Repeat this 4-5 times to check we don't crash or freeze

Tumblr Integration

Test instructions + JIRA Ticket

Etc

CC: @bjtitus I'd like your eyes on the fix commit. I'm making what I think to be a safe assumption that we'd always want to encode a gif once the user has set the camera to gif mode. If this isn't the case I may need to expand this PR to prevent us getting to this state in the first place

  • I have considered if this change warrants release notes and have added them to the appropriate section in the CHANGELOG.md if necessary.

Deco354 added 4 commits May 30, 2023 16:52
settings.feature.gifs is designed for configuring the MediaPicker
I've been unable to find a scenario where the camera mode is set
to .gif and we don't want a gif.
@mindgraffiti mindgraffiti self-requested a review June 1, 2023 13:17
Copy link
Member

@mindgraffiti mindgraffiti left a comment

Choose a reason for hiding this comment

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

  • 1 nit
  • tested on device using example app (do you want this tested in Orangina too? I didn't do that part)

I tried out several of the filters and "plain" gifs and didn't encounter any weirdness or bugs.

Comment on lines 77 to 78
assetsHandler:
handler,
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
assetsHandler:
handler,
assetsHandler: handler,

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Nice catch. 👍

Copy link
Member

@mindgraffiti mindgraffiti left a comment

Choose a reason for hiding this comment

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

  • 1 nit
  • tested on device using example app (do you want this tested in Orangina too? I didn't do that part)

I tried out several of the filters and "plain" gifs and didn't encounter any weirdness or bugs.

Co-authored-by: Thuy.Copeland <[email protected]>
Copy link
Collaborator

@bjtitus bjtitus left a comment

Choose a reason for hiding this comment

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

It's been a while since I looked at any video export stuff but I think this makes sense. Thanks for making the change!

✅ I was able to encode GIFs without enabling the GIF setting.

@Deco354
Copy link
Collaborator Author

Deco354 commented Jun 2, 2023

do you want this tested in Orangina too? I didn't do that part

Yes please if you get the chance. The PR is primarily to fix an issue on Orangina so it's probably best we test it now rather than in the Orangina PR which may require another Kanvas PR if the testing doesn't work.

Unless @bjtitus did the Orangina testing in which case I think we're good to go.

@bjtitus
Copy link
Collaborator

bjtitus commented Jun 2, 2023

@Deco354 I just now verified the Orangina PR using that branch and the test instructions over there. Everything looks good ✅

@Deco354
Copy link
Collaborator Author

Deco354 commented Jun 2, 2023

I have considered if this change warrants release notes and have added them to the appropriate section in the CHANGELOG.md if necessary.

I'll do this within the version bump PR

@Deco354 Deco354 merged commit 940ec08 into main Jun 2, 2023
@Deco354 Deco354 deleted the declan/PROD-17928-GIFs-encoding-fix branch June 2, 2023 05:47
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.

3 participants