Skip to content

fix(ios): tempFilePath called twice if using CameraUsesGeolocation#612

Merged
jcesarmobile merged 1 commit intoapache:masterfrom
jcesarmobile:temp-file-twice
Jun 25, 2020
Merged

fix(ios): tempFilePath called twice if using CameraUsesGeolocation#612
jcesarmobile merged 1 commit intoapache:masterfrom
jcesarmobile:temp-file-twice

Conversation

@jcesarmobile
Copy link
Copy Markdown
Member

@jcesarmobile jcesarmobile commented Jun 19, 2020

Platforms affected

ios

Motivation and Context

When using <preference name="CameraUsesGeolocation" value="true" />, the image is saved twice and calls tempFilePath, which could cause an infinite loop as reported on #591 (couldn't reproduce)

Description

Instead of doing as on #592, which put the timestamp check inside the while to fix the possible infinite loop, this PR fixes the problem of the image being saved twice.

It removes the while because it was there for an older code that used an int that was incremented until the file didn't exist and used that int for the image name. Now that uses the timestamp and it's not called twice there is no need for the while.

fixes #591
closes #592

Testing

Checklist

  • I've run the tests to see all new and existing tests pass
  • I added automated test coverage as appropriate for this change
  • Commit is prefixed with (platform) if this change only applies to one platform (e.g. (android))
  • If this Pull Request resolves an issue, I linked to the issue in the text above (and used the correct keyword to close issues using keywords)
  • I've updated the documentation if necessary

@jcesarmobile jcesarmobile requested review from erisu and timbru31 June 19, 2020 17:40
@jcesarmobile jcesarmobile merged commit d89c25c into apache:master Jun 25, 2020
@jcesarmobile jcesarmobile deleted the temp-file-twice branch June 25, 2020 16:23
IT-MikeS pushed a commit to OutSystems/cordova-plugin-camera that referenced this pull request Mar 18, 2024
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.

iOS: Infinite loop in tempFilePath (master branch)

1 participant